fix: move CI permissions and env to job-level scope#141
Merged
Conversation
…erated CI Security scanners (e.g., SonarQube) flag workflow-level permissions as a vulnerability because they grant access to all jobs, including the gate job which only checks results and needs no special access. Move ci.permissions and ci.env from workflow-level to individual job definitions (validate and coverage jobs). The all-validation-passed gate job inherits no unnecessary permissions or env vars. Concurrency remains at workflow level as it governs the whole workflow. 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 #141 +/- ##
=======================================
Coverage 85.81% 85.81%
=======================================
Files 115 115
Lines 14990 14997 +7
Branches 3241 3242 +1
=======================================
+ Hits 12863 12870 +7
Misses 2127 2127 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Consolidate generate-workflow fixes (job-level permissions, indentation, build auto-detection) into a single changelog entry. Bump all packages from 0.19.1-rc.1 to 0.19.1-rc.2. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
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
ci.permissionsandci.envfrom workflow-level to job-level in the generatedvalidate.ymlvalidateandcoveragejobs receive these settings — theall-validation-passedgate job inherits nothing it doesn't needconcurrencyremains at workflow level (governs the whole workflow)Why
Security scanners (SonarQube, etc.) flag workflow-level
permissionsblocks as a vulnerability because they grant access to all jobs indiscriminately. The gate job only runs a bashifcheck on job results — it needs no special permissions, env vars, or registry access.This makes the generated workflow more surgical: each job declares exactly what it needs, and the gate job runs with minimal defaults.
Breaking change?
No. The generated workflow produces identical CI behavior. The only difference is where
permissionsandenvappear in the YAML (job-level vs workflow-level). Downstream repos will see a diff when they rungenerate-workflowafter upgrading, but the workflow behavior is unchanged.Test plan
vv validatepasses (Pre-Qualification + Testing)🤖 Generated with Claude Code