Skip to content

ci: scan issue and comment bodies — this repo has never scanned one - #32

Open
yakimoto wants to merge 5 commits into
mainfrom
ci/1747-public-repo-guard-body-scan
Open

yakimoto wants to merge 5 commits into
mainfrom
ci/1747-public-repo-guard-body-scan

Conversation

@yakimoto

@yakimoto yakimoto commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This repo's public-repo-guard has never scanned a single issue or comment body.

Measured across all 28 public wave-av repos (wave-av/claude-workstation#1747, #1794): two coverage shapes satisfy the one required check name Secrets + content policy.

repos triggers jobs
27 pull_request, push, workflow_dispatch guard
1 + issues, issue_comment + body-guard

This repo is in the 27. All 28 report the same green check — because a required check asserts that something named X passed, never what X examined.

The outlier is wave-moq-edge, and its own comment says why it matters:

edited matters as much as opened: a body can be made to leak long after the PR is first raised, and until this workflow covered it, nothing ever re-scanned.

That gap was not theoretical there: a PR was blocked for naming a private repo in wrangler.toml while the very same name, with more operational detail attached, sat unchallenged in its body.

What lands

Three files — the bundle the workflow's own header names, minus what this repo already has (.gitleaks.toml and content-policy.sh are already vendored, and are checked as prerequisites; a repo missing either is refused rather than half-installed):

.github/workflows/public-repo-guard.yml               replaced (72 -> 163 lines)
scripts/public-repo-guard/body-policy.sh              new, mode 100755
scripts/public-repo-guard/tests/body-policy.test.sh   new, mode 100755

The workflow's header names four files as the install unit but executes a fifthtests/body-policy.test.sh, in its own self-test step. Omitting it installs a workflow that fails on a step nobody read, so the manifest ships it. Modes are preserved via the git trees API; the contents API creates 100644 regardless, which would silently break running these scripts as executables.

Planned by governance/lib/vendor-bundle.mjs (claude-workstation#1850) against a checked-in manifest, not by ad-hoc shell.

One deliberate divergence from the reference, stated rather than silent

The shipped workflow is wave-moq-edge's with actions/checkout bumped from v5.0.1 to v7.0.1 (3d3c42e5aac5ba805825da76410c181273ba90b1), the pin already used by claude-workstation's own gate.

Copying verbatim was checked first and rejected on evidence: of the 18 target repos, 17 carry a byte-identical guard, and wave-realtime-edge already runs v7.0.0 — so a verbatim copy would have downgraded it, and shipped a stale pin to the other 17. A separate PR brings the reference itself up to the same pin.

Honest about what this can and cannot do

On a PR this PREVENTS the merge. On an issue, comment, or review the text is already public the moment it posts, so this is DETECTION: it says go redact, fast. Only a client-side pre-write hook stops that class before publication.

Review-surface text (submitted review bodies and inline review comments) arrives as pull_request_review / pull_request_review_comment, not issue_comment; both triggers were added during review so no world-readable body class is left unscanned.

Also inherited from the reference: concurrency moves from workflow-level to per job, because the two jobs want opposite behaviour. A workflow-level group forced one policy on both, and rapid body edits cancelled the tree job repeatedly — every cancelled check-run stays attached to the commit, so the PR reported UNSTABLE while the live runs were green.

The body gate ships with its own fixtures and runs them in CI. Its negative cases are the load-bearing half: a leak gate that blocks legitimate cross-repo references gets switched off, and then it protects nothing.

Refs wave-av/claude-workstation#1747.


View with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.


Note

Medium Risk
Changes security gate behavior and CI triggers for all PR/issue/comment activity; mis-tuned body rules could block legitimate merges or miss leaks, but scope is vendored scripts and read-only workflow permissions.

Overview
Extends public-repo-guard so world-readable PR, issue, and comment text is scanned server-side, not only the published tree. The workflow now triggers on edited events (bodies can leak after first open) and adds a body-guard job that materializes untrusted title/body from the event payload into a file and runs body-policy.sh—without shell interpolation of hostile body content.

The existing guard job is narrowed so it skips issue/comment events and PR edited (tree unchanged), and concurrency is per job: tree scans can cancel in progress; body scans do not, so cancelled checks do not leave PRs looking unstable.

body-policy.sh mirrors many tree rules (credentials, infra IDs, internal markers) but diverges on private repos: bare cross-repo mentions are allowed; blocks apply when a configured private name appears within ~140 characters of operational detail (credential names, secret bindings, secret counts). Violation output redacts matched text in annotations. body-policy.test.sh exercises block/pass precision and fail-closed paths; the tree job runs those fixtures in CI.

actions/checkout is bumped to v7.0.1 in both jobs; body-guard uses sparse checkout of scripts/public-repo-guard only.

Reviewed by Cursor Bugbot for commit 9457c13. Configure here.

Note

Scan PR/issue/comment bodies for policy violations in public-repo-guard CI

  • Adds a new body-guard job in public-repo-guard.yml that runs on PR, issue, comment, and review events, materializing untrusted title/body text from $GITHUB_EVENT_PATH and scanning it via the new body-policy.sh.
  • body-policy.sh uses ripgrep (PCRE2) to check for credential-shaped strings and concrete infra identifiers (HARD rules, not bypassable) plus other configurable patterns; it prints redacted GitHub annotations and returns exit code 0 (clean), 1 (blocking), or 2 (scanner error).
  • The existing guard job gains an if filter to skip non-tree-changing events (issue/comment edits), reducing unnecessary runs.
  • A fixture-based self-test suite body-policy.test.sh runs in CI as part of the guard job.
  • Risk: blocking violations on pull requests will prevent merging; the scanner fails closed on ripgrep errors (exit 2 treated as failure).

Macroscope summarized 95db039.

Review in cubic

…ment body

Measured across all 28 public wave-av repos (claude-workstation#1747, #1794):
TWO coverage shapes satisfy the one required check name `Secrets + content policy`.

  27 repos  triggers: pull_request, push, workflow_dispatch      jobs: guard
   1 repo   triggers: + issues, issue_comment                    jobs: + body-guard

This repo is in the 27. All 28 report the same green check.

The outlier is wave-moq-edge, and its own comment says why it matters:

  "`edited` matters as much as `opened`: a body can be made to leak long after the
   PR is first raised, and until this workflow covered it, nothing ever re-scanned."

A PR/issue/comment BODY is exactly as world-readable as the tree, and until now it
was scanned by nothing server-side. That gap was not theoretical on wave-moq-edge: a
PR was blocked for naming a private repo in wrangler.toml while the very same name,
with more operational detail attached, sat unchallenged in its body.

WHAT LANDS HERE — the bundle the workflow's own header names, minus what this repo
already has (.gitleaks.toml and content-policy.sh are already vendored):

  .github/workflows/public-repo-guard.yml          replaced (73 -> 163 lines)
  scripts/public-repo-guard/body-policy.sh         new, mode 100755
  scripts/public-repo-guard/tests/body-policy.test.sh  new, mode 100755

Copied from wave-moq-edge, which has run this shape in production. Modes preserved
via the git trees API — the contents API would have created both scripts 100644.

HONEST ABOUT WHAT IT CAN DO. On a PR this PREVENTS the merge. On an issue or comment
the text is already public the moment it posts, so this is DETECTION: it says go
redact, fast. Only a client-side pre-write hook stops that class before publication.

Also inherited from the reference: concurrency moves from workflow-level to PER JOB,
because the two jobs want opposite behaviour. A workflow-level group forced one
policy on both, and rapid body edits cancelled the tree job repeatedly — every
cancelled check-run stays attached to the commit, so the PR reported UNSTABLE while
the live runs were green.

The body gate ships with its own fixtures and runs them in CI. Its NEGATIVE cases are
the load-bearing half: a leak gate that blocks legitimate cross-repo references gets
switched off, and then it protects nothing.

Refs wave-av/claude-workstation#1747.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@yakimoto yakimoto added the rr:skip-coderabbit RF.P1 reviewer routing (#1039) label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Excluded labels (none allowed) (1)
  • rr:skip-coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 81a76063-da17-4c4c-83f1-fcbc045ac355

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_408266c9-b601-43bd-9d43-71fbbc3d4fa7)

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Running ultrareview automatically — This PR changes the public-repo-guard CI itself — adding a body-scanning job with regex/allowlist logic and new issue/comment triggers — so a missed bug could either leak secrets through the gate or break the required check on every PR.. I'll post findings when complete.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

CI: add issue/comment body scanning to public-repo-guard

✨ Enhancement ⚙️ Configuration changes 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Add issue/PR/comment body scanning to close public text leak gaps.
• Split job concurrency to prevent body edits cancelling tree scans.
• Add body-policy script and fixtures to keep the gate precise and safe.
Diagram

graph TD
  events{{"GitHub events"}} --> wf["public-repo-guard workflow"]
  wf --> tree["Job: Secrets + content policy"] --> cps["content-policy.sh (tree scan)"] --> ann["GitHub annotations / status"]
  wf --> body["Job: Body content policy"] --> mat["Materialize body.txt from event"] --> bps["body-policy.sh (text scan)"] --> ann
  tree --> fixtures["body-policy.test.sh (fixtures)"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Central reusable workflow (org-level reference)
  • ➕ Single place to update pins, rules, and event schema handling across repos
  • ➕ Reduces drift and makes coverage guarantees easier to audit
  • ➖ Requires trust and governance around the shared workflow source
  • ➖ Still needs per-repo installation/required-check wiring
2. GitHub Advanced Security secret scanning for issues/comments
  • ➕ Native platform capability; no custom regex maintenance
  • ➕ Can provide alerting workflows and triage tooling
  • ➖ May require licensing/enablement not available to all repos/orgs
  • ➖ Does not cover the same content-policy constraints as this bespoke gate
3. Single job handling both tree and body scans
  • ➕ Simpler workflow surface area (one job, one concurrency policy)
  • ➕ Potentially fewer moving parts
  • ➖ Conflicting concurrency needs (tree wants cancel-in-progress; body wants full history)
  • ➖ Higher cost: would re-checkout and re-scan tree on every comment edit

Recommendation: Keep the PR’s split-job approach: it cleanly separates tree scanning from body scanning, enabling event-appropriate concurrency and cost control while closing a real coverage gap. If this pattern is being rolled out broadly, consider a follow-up to publish the workflow as an org-managed reusable workflow to reduce drift and simplify future pin/rule updates.

Files changed (3) +342 / -5

Enhancement (1) +139 / -0
body-policy.shIntroduce body-specific content policy scanner +139/-0

Introduce body-specific content policy scanner

• Adds a new ripgrep-based policy script that scans PR/issue/comment text from a file, fails closed on scanner errors, and redacts matched content from annotations. Implements allowlisting (guard:allow and “about the control” patterns) and body-appropriate rules, including proximity-based private-repo + operational-detail detection driven by GUARD_PRIVATE_REPOS.

scripts/public-repo-guard/body-policy.sh

Tests (1) +108 / -0
body-policy.test.shAdd fixture tests for body-policy precision and safety +108/-0

Add fixture tests for body-policy precision and safety

• Introduces fixture-only tests covering blocking detections, precision cases that must pass, and fail-closed behavior. Verifies that error output does not echo matched sensitive text, and keeps tests hermetic by setting GUARD_PRIVATE_REPOS within the test harness.

scripts/public-repo-guard/tests/body-policy.test.sh

Other (1) +95 / -5
public-repo-guard.ymlAdd body scanning job and issue/comment triggers +95/-5

Add body scanning job and issue/comment triggers

• Extends workflow triggers to include issues and issue_comment (and PR edited/reopened/synchronize) and introduces a new body-guard job. Adds per-job concurrency (tree cancels in-progress; body preserves all runs), bumps actions/checkout pin, and materializes untrusted event text to a file for scanning with jq.

.github/workflows/public-repo-guard.yml

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 6, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 6, 2026

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

Unable to check for correctness in 95db039. New CI security gate feature with significant logic. An unresolved review comment identifies a valid bypass vulnerability: the body-guard job runs the policy script from the PR's own checkout, allowing malicious PRs to modify the script and bypass the gate. Security infrastructure changes with open security concerns warrant human review.

You can customize Macroscope's approvability policy. Learn more.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 5 potential issues.

Open in Devin Review

Comment thread scripts/public-repo-guard/body-policy.sh
Comment thread scripts/public-repo-guard/body-policy.sh Outdated
expect() {
local want="$1" name="$2" body="$3" out rc
printf '%s\n' "$body" > "$TMP/body.txt"
out="$(bash "$SCRIPT" "$TMP/body.txt" 2>&1)"; rc=$?

@devin-ai-integration devin-ai-integration Bot Aug 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 The apt fallback can install a ripgrep without PCRE2, turning the new probe into a permanent red job

Both the tree gate and the new body gate use rg -P. The install step is command -v rg >/dev/null || apt-get install -y ripgrep. On Ubuntu 22.04 the distro package (ripgrep 13.0.0-2ubuntu0.1) is built WITHOUT PCRE2 — verified locally: printf 'probe' | rg -P '^probe$' exits 2. If the hosted runner image does not already ship a PCRE2-enabled ripgrep, the new probe at scripts/public-repo-guard/body-policy.sh:34-35 makes body-guard fail with exit 2 on every PR/issue/comment (and content-policy.sh would already be failing closed on every rule). Worth confirming against an actual green run of this workflow; if the runner's rg is the apt build, the install step should download a PCRE2-enabled ripgrep release instead of relying on apt.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread .github/workflows/public-repo-guard.yml
Comment thread .github/workflows/public-repo-guard.yml
@qodo-code-review

qodo-code-review Bot commented Aug 6, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Install comment omits test file ✓ Resolved 🐞 Bug ⚙ Maintainability
Description
The workflow’s install instructions say to copy only four files, but the workflow unconditionally
executes scripts/public-repo-guard/tests/body-policy.test.sh in the guard job. Following the comment
will install a workflow that fails at runtime due to the missing test script.
Code

.github/workflows/public-repo-guard.yml[R16-20]

+# To install on a new repo, copy all four files together:
#   .github/workflows/public-repo-guard.yml
#   .gitleaks.toml
#   scripts/public-repo-guard/content-policy.sh
+#   scripts/public-repo-guard/body-policy.sh
Evidence
The workflow’s header lists only four files to copy, but later the workflow runs a self-test script
located under scripts/public-repo-guard/tests; omitting it will make the workflow fail when
installed elsewhere per the comment.

.github/workflows/public-repo-guard.yml[16-21]
.github/workflows/public-repo-guard.yml[96-102]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The workflow header says to copy 4 files, but `guard` runs `scripts/public-repo-guard/tests/body-policy.test.sh`. Anyone following the documented install instructions will end up with a broken workflow.

## Issue Context
The self-test step is valuable, so either (a) document the test file as part of the install bundle, or (b) change the workflow to not require it unconditionally (e.g., run the self-test only if the file exists).

## Fix Focus Areas
- .github/workflows/public-repo-guard.yml[16-21]
- .github/workflows/public-repo-guard.yml[96-102]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Allowlist suppresses whole line ✓ Resolved 🐞 Bug ⛨ Security
Description
body-policy.sh drops any matching line containing the exact guard:allow <reason> marker or
matching the ABOUT_THE_CONTROL regex, before evaluating violations. Because this job scans untrusted
PR/issue/comment text, an author can append a valid allow marker (or an allowlisted
control-discussion phrase) to the same line as a leaking token/identifier and suppress detection for
that line across all checks.
Code

scripts/public-repo-guard/body-policy.sh[R53-56]

+  matches="$(printf '%s' "$raw" \
+    | rg -vN -- 'guard:allow[[:space:]]+[^[:space:]]' \
+    | rg -vNiP -- "$ABOUT_THE_CONTROL" || true)"
+  [[ -z "$matches" ]] && return 0
Evidence
The script explicitly filters out (removes) lines containing guard:allow <reason> and lines
matching ABOUT_THE_CONTROL before it decides whether to block, and the workflow feeds it untrusted
event-body text; the fixtures also assert that a line containing guard:allow is allowed,
demonstrating the intended suppression behavior.

scripts/public-repo-guard/body-policy.sh[31-36]
scripts/public-repo-guard/body-policy.sh[53-56]
.github/workflows/public-repo-guard.yml[138-163]
scripts/public-repo-guard/tests/body-policy.test.sh[72-76]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The current allowlisting is line-wide: if a line contains `guard:allow <reason>` (or matches ABOUT_THE_CONTROL), the entire line is excluded from reporting, even if it also contains a high-confidence secret/identifier match. Since the workflow scans untrusted PR/issue/comment bodies, a leaking line can be trivially suppressed by appending the allow marker or allowlisted phrase to that same line.

## Issue Context
Fixtures intentionally rely on `guard:allow` for documentation examples, so the goal is not to remove allowlisting entirely, but to prevent it from masking unrelated violations on the same line.

## Fix Focus Areas
- scripts/public-repo-guard/body-policy.sh[31-36]
- scripts/public-repo-guard/body-policy.sh[53-56]
- scripts/public-repo-guard/tests/body-policy.test.sh[72-76]
- .github/workflows/public-repo-guard.yml[138-163]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 3 rules
Review mode: ⚖️ Balanced: Downgraded extended -> standard: change is below the extended eligibility bar (hunks 5/18, lines 347/200; both must reach the floor). Router rationale: This adds security-sensitive CI behavior plus substantial independent workflow, event-payload, regex-scanner, and fixture-test logic, creating multiple easy-to-miss failure and bypass modes.

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

qodo-code-review[bot]

This comment was marked as resolved.

@qodo-code-review

Copy link
Copy Markdown

Qodo Fixer

No findings are within the configured fix scope. To change which findings are fixed, adjust the setting on your Qodo configuration page.

…list from hard hits, probe pcre2, rerun tree scan on base retarget

Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
@yakimoto
yakimoto force-pushed the ci/1747-public-repo-guard-body-scan branch from 4044e64 to c21e064 Compare August 6, 2026 17:32
…hard rules from all line-level allowlists

Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultrareview completed in 11m 14s

1 issue found and verified against the latest diff

Confidence score: 2/5

  • In .github/workflows/public-repo-guard.yml, the workflow runs scripts/public-repo-guard/body-policy.sh from PR-controlled contents, so a contributor can alter the script in the same PR to bypass the body scan and merge policy-violating changes unnoticed—run the policy from a trusted ref (for example, base/default branch) or inline/pin the check logic in the workflow.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/public-repo-guard.yml">

<violation number="1" location=".github/workflows/public-repo-guard.yml:136">
P0: The new body scan can be bypassed on PRs because it executes `scripts/public-repo-guard/body-policy.sh` from the checked-out PR contents. That lets a contributor modify the policy script in the same PR and make the check pass even when the body contains content the gate is meant to block. Using a trusted ref for the policy checkout (for PRs, the base SHA) would keep the scanner logic immutable from the untrusted change being evaluated.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

with:
# Only the gate's own scripts are needed — no reason to pay for the whole
# tree on every comment.
sparse-checkout: scripts/public-repo-guard

@cubic-dev-ai cubic-dev-ai Bot Aug 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0: The new body scan can be bypassed on PRs because it executes scripts/public-repo-guard/body-policy.sh from the checked-out PR contents. That lets a contributor modify the policy script in the same PR and make the check pass even when the body contains content the gate is meant to block. Using a trusted ref for the policy checkout (for PRs, the base SHA) would keep the scanner logic immutable from the untrusted change being evaluated.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/public-repo-guard.yml, line 132:

<comment>The new body scan can be bypassed on PRs because it executes `scripts/public-repo-guard/body-policy.sh` from the checked-out PR contents. That lets a contributor modify the policy script in the same PR and make the check pass even when the body contains content the gate is meant to block. Using a trusted ref for the policy checkout (for PRs, the base SHA) would keep the scanner logic immutable from the untrusted change being evaluated.</comment>

<file context>
@@ -71,3 +92,72 @@ jobs:
+        with:
+          # Only the gate's own scripts are needed — no reason to pay for the whole
+          # tree on every comment.
+          sparse-checkout: scripts/public-repo-guard
+          sparse-checkout-cone-mode: false
+
</file context>
Suggested change
sparse-checkout: scripts/public-repo-guard
ref: ${{ github.event.pull_request.base.sha || github.sha }}
sparse-checkout: scripts/public-repo-guard
Fix with cubic

devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment on lines +60 to +64
if: >-
(github.event_name == 'pull_request'
&& (github.event.action != 'edited' || github.event.changes.base != null))
|| github.event_name == 'push'
|| github.event_name == 'workflow_dispatch'

@devin-ai-integration devin-ai-integration Bot Aug 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Tree job now reports 'skipped' for the required check on body-only edits

With the new job-level if, a pull_request: edited event (title/body edit without a base change) still starts the workflow but skips guard, producing a check run named Secrets + content policy with conclusion skipped on the head commit. GitHub treats a skipped job as passing for required status checks, so this should not block or falsely green anything, but it does mean the most recent instance of the required check on a PR can be a skip rather than a real scan. Worth confirming against this repo's branch-protection configuration if it uses any tooling that distinguishes skipped from success.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

cubic-dev-ai[bot]

This comment was marked as resolved.

Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment on lines +147 to +152
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Only the gate's own scripts are needed — no reason to pay for the whole
# tree on every comment.
sparse-checkout: scripts/public-repo-guard
sparse-checkout-cone-mode: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟨 Body-scanning gate executes the gate script from the pull request's own branch

The new body-guard job checks out the PR's merge ref by default and then runs scripts/public-repo-guard/body-policy.sh from that checkout, so a pull request (including one from a fork) can modify or neuter the very script that is supposed to block leaks in its title/body. The tree guard job has the same property for content-policy.sh, but the new job extends the pattern to the body gate as well. Impact is limited to gate evasion (the job runs with a read-only token and no secrets other than the GUARD_PRIVATE_REPOS variable), not code execution against protected resources.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rr:skip-coderabbit RF.P1 reviewer routing (#1039)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant