fix: auto-inject contents:read when ci.permissions is set#142
Merged
Conversation
Job-level permissions replace all GitHub Actions defaults, so actions/checkout fails with "repository not found" unless contents:read is explicitly listed. Now auto-injected as a baseline whenever ci.permissions is configured. User-specified contents values (e.g. contents:write) take precedence. Bump to 0.19.1-rc.3. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #142 +/- ##
=======================================
Coverage 85.81% 85.81%
=======================================
Files 115 115
Lines 14997 14997
Branches 3242 3242
=======================================
Hits 12870 12870
Misses 2127 2127 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
contents: readinto job-level permissions wheneverci.permissionsis configuredcontentsvalues (e.g.,contents: write) take precedence0.19.1-rc.3Why
Follow-up to PR #141 (job-level permissions). Job-level
permissionsin GitHub Actions replace all defaults — unlike workflow-level permissions which narrow them. This meansactions/checkoutfails with "repository not found" on private repos unlesscontents: readis explicitly listed.Rather than requiring every consumer to remember this, vibe-validate now handles it automatically.
Test plan
vv validatepasses (Pre-Qualification + Testing)packages: readproduces{ contents: read, packages: read }in YAMLcontents: writepreserveswrite(not overridden)🤖 Generated with Claude Code