fix: grant packages:read + security-events:write to published-images scan#540
Conversation
…s scan After build-logic added `packages: read` and `security-events: write` to the `reusable-vulnerability-scan.yml` job-level permissions block (2026-04-17), every scheduled run of `trivy-scan-published-images.yml` began failing with startup_failure: "The nested job 'vulnerability-scan' is requesting 'packages: read, security-events: write', but is only allowed 'packages: none, security-events: none'." GitHub enforces that a called reusable's job permissions must not exceed the caller's effective permissions. The `vulnerability-scan` job in this caller had no job-level permissions, so it inherited workflow-level, which was missing both scopes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request updates workflow-level permissions in the Trivy vulnerability scanning workflow file. Two new permissions are added to allow image pulling from GHCR and security event reporting, while the existing Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
Claude finished @jnewton03's task in 26s —— View job Code ReviewTask Checklist
AnalysisLGTM - The fix correctly addresses the reported issue. Why the fix works:
Pattern consistency:
No issues found:
|
Summary
Fixes the daily
Published Images Vulnerability Scanningscheduled workflowfailing with
startup_failuresince 2026-04-17.Root cause: On 2026-04-17,
liquibase/build-logicaddedpackages: readandsecurity-events: writeto thevulnerability-scanjob-level permissions inreusable-vulnerability-scan.yml. GitHub's reusable-workflow contract requiresthe caller's effective permissions to be a superset of what the called reusable's
jobs declare. The
vulnerability-scancaller job had no job-level permissions, soit inherited the workflow-level block, which was missing both scopes. Every
scheduled run has produced this error since then:
Fix: Add both missing permissions at the workflow level in
.github/workflows/trivy-scan-published-images.yml, matching the pattern alreadyused in the sibling
trivy.ymlworkflow.Failing runs addressed
Not in scope
test.yml/trivy.ymlstartup failures) — caused bysecrets: inheritmisplaced inside
on: workflow_call:in thedat-22876-reusablesbranch ofbuild-logic. Already fixed upstream; those runs self-heal on next PR push.Test plan
gh workflow run trivy-scan-published-images.yml --repo liquibase/docker -f max_tags_to_scan=1and confirm jobs start (not
startup_failureat 1s)🤖 Generated with Claude Code