fix(ci): resolve all zizmor findings and add zizmor pre-commit checks - #2373
Conversation
eee7d20 to
8e00b91
Compare
`zizmor` always flags these triggers because they are easy to use incorrectly. These usages are ok and don't execute any PR-specific code (and so aren't susceptible to exploits from forked PRs)
📝 WalkthroughSummary by CodeRabbit
WalkthroughTop-level GitHub Actions permissions are default-denied and replaced by explicit, per-job permission declarations across several workflows; Zizmor is added and configured; one job gains Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 8/10 reviews remaining, refill in 8 minutes and 9 seconds. 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/zizmor.yml:
- Around line 4-9: The repo-wide ref-pin policy still leaves floating refs in
workflows; address the two offending action refs (actions/labeler@v5 and
nv-gha-runners/get-pr-info@main) by either SHA-pinning those workflow uses to
their corresponding commit SHAs or explicitly exempting them in the zizmor
policies block (add entries like "actions/labeler@v5": any and
"nv-gha-runners/get-pr-info@main": any) so the overall "*": ref-pin policy no
longer fails.
🪄 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: Enterprise
Run ID: 48620777-67a8-42da-a2e9-d1d8126c50b3
📒 Files selected for processing (8)
.github/workflows/build.yaml.github/workflows/labeler.yml.github/workflows/new-issues-to-triage-projects.yml.github/workflows/pr.yaml.github/workflows/test.yaml.github/workflows/trigger-breaking-change-alert.yaml.github/zizmor.yml.pre-commit-config.yaml
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/pr.yaml (1)
60-63:⚠️ Potential issue | 🔴 CriticalAdd
pull-requests: readandcontents: readtocheck-nightly-cijob permissions.The
get-pr-infoaction (line 72) calls the GitHub REST API to fetch pull request details, which requires bothpull-requests: readandcontents: readpermissions. Without these, the action will fail with a 403 error when attempting to read the PR metadata (line 77). The globalpermissions: {}at line 9 removes default scopes, so these must be explicitly declared at the job level.Required permission adjustment
check-nightly-ci: runs-on: ubuntu-latest permissions: actions: read + contents: read id-token: write + pull-requests: read🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pr.yaml around lines 60 - 63, The check-nightly-ci job's permissions block currently only grants actions: read and id-token: write; update that permissions map to also include pull-requests: read and contents: read so the get-pr-info action can call the REST API without 403s—modify the permissions object in the check-nightly-ci job (the permissions: ... block surrounding actions/id-token) to add pull-requests: read and contents: read.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In @.github/workflows/pr.yaml:
- Around line 60-63: The check-nightly-ci job's permissions block currently only
grants actions: read and id-token: write; update that permissions map to also
include pull-requests: read and contents: read so the get-pr-info action can
call the REST API without 403s—modify the permissions object in the
check-nightly-ci job (the permissions: ... block surrounding actions/id-token)
to add pull-requests: read and contents: read.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d1410a7d-2aab-4abb-8657-7c67061d9436
📒 Files selected for processing (3)
.github/workflows/labeler.yml.github/workflows/pr.yaml.github/zizmor.yml
✅ Files skipped from review due to trivial changes (1)
- .github/zizmor.yml
|
/merge |
Similar to upstream changes in
shared-workflows, this PR cleans up and annotates all of the workflows and adds thezizmorlinter to make sure changes are checked.Part of rapidsai/build-planning#275