fix(ci): grant actions: read so the security workflow can start - #35
Conversation
An explicit permissions block sets every unlisted scope to none, so the reusable security-scan workflow's CodeQL and SARIF-upload jobs were requesting more than this caller granted. GitHub rejects that at run creation, which is why every run of this workflow has been startup_failure rather than a normal failure — no job ever started, and no logs were produced. npm, dotnet-sdk, landing, research and programs already carry this line and their scans pass; crates, dev, docs and viz do not and all fail. The rationale comment is copied verbatim from the repos that already had it. Read-only; grants no write capability.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe security workflow now grants ChangesSecurity workflow permissions
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adding `actions: read` was necessary but not sufficient here. This repo was the only one in the org pinned to security-scan.yml@94363a6a, an intermediate version whose `vet` job declared `pull-requests: write` and `issues: write`. A called workflow may not request scopes the caller has not granted, and that is validated when the run is created — a job-level `if` does not exempt it — so the run was rejected before any job started. Upstream already fixed this: at .github@44987ffd those write perms were deliberately dropped, with a comment explaining that keeping security-scan read-only is what lets it be called cross-repo without forcing consumers to grant write scopes. landing already pins 44987ffd with only `actions: read` and its scan passes. Repin to 44987ffd. Verified at that ref: the languages and enable-semgrep inputs are declared, SEMGREP_APP_TOKEN and SNYK_TOKEN are declared, and no job requests anything beyond contents/security-events/pull-requests/actions.
This repo needed a second change
vet:
permissions:
contents: read
pull-requests: write # inline PR comments on changed deps
issues: writeA called workflow may not request scopes the caller has not granted, and that is validated when the run is created — a job-level The obvious fix would have been to grant those write scopes. That is the wrong move, and upstream already decided so. At
So instead of escalating this repo's permissions, this branch repins to Verified at Result: |
|
Audit passed: The addition of Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
What
This repo's
securityworkflow has never run. Every invocation ends instartup_failure— GitHub rejects the run at creation, so no job starts and no logs are produced. That is why it was invisible in normal triage:startup_failureis not in the default status set most tooling scans for, and there is nothing to read even when you find it.Root cause
security.ymlis a thin caller for the org-wide reusable workflowresq-software/.github/.github/workflows/security-scan.yml. That workflow's CodeQL and SARIF-upload jobs declareactions: read.An explicit
permissions:block sets every unlisted scope tonone. Since the caller listed onlycontents,security-eventsandpull-requests, the nested jobs requested a permission the caller did not grant — and GitHub refuses to create the run.Evidence
The correlation across the org is exact, with no exceptions:
actions: readsecurityrunRuled out along the way: the pinned reusable-workflow SHA resolves and the file exists at it; the
languages/submodulesinputs are declared and correctly typed; the reusable workflow's ownpermissionsblock matches the caller's other three scopes;resq-software/.githubis public, so repo access policy does not apply. Notably the working and broken repos pin the same SHA — so it is the caller, not the callee.Fix
One line, plus the rationale comment copied verbatim from the repos that already had it — this was diagnosed once before and simply never propagated to the other four.
Read-only. Grants no write capability.
Verification
actionlintcleanpermissions.actions == "read"securityshould now actually start and run instead ofstartup_failureCompanion PRs opened against
crates,dev,docsandviz— all four carry the identical change.Summary by CodeRabbit