ci: add minimal permissions to GitHub Actions workflows#1015
ci: add minimal permissions to GitHub Actions workflows#1015mergify[bot] merged 1 commit intopython-wheel-build:mainfrom
Conversation
b005f6f to
396fbe4
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded top-level Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/python-publish.yaml:
- Around line 9-11: The job-level permissions for the build-n-publish job
currently only set id-token: write which overrides the workflow-level
permissions and leaves contents as none; update the build-n-publish job
permissions to include contents: read so the actions/checkout step can access
the repository (i.e., add contents: read alongside id-token: write in the job
permissions block for the build-n-publish job).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6cd0b6e7-80bc-45d5-a29e-cf66955af8ab
📒 Files selected for processing (3)
.github/workflows/check.yaml.github/workflows/python-publish.yaml.github/workflows/test.yaml
Add top-level `permissions: contents: read` to all three workflows (test, check, python-publish) to follow the GitHub security hardening recommendation of least-privilege token permissions. The publish workflow's existing job-level `id-token: write` override remains intact for trusted publishing. See: python-wheel-build#1008 Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Christian Heimes <cheimes@redhat.com>
396fbe4 to
2e9f9b8
Compare
rd4398
left a comment
There was a problem hiding this comment.
This looks good! Thank you!
Pull Request Description
What
Add top-level
permissions: contents: readto all three workflows (test, check, python-publish) to follow the GitHub security hardening recommendation of least-privilege token permissions. The publish workflow's existing job-levelid-token: writeoverride remains intact for trusted publishing.Why
See: #1008