Skip to content

ci: scope the benchmark workflow's checks permission to its report job - #14879

Merged
zkochan merged 1 commit into
mainfrom
fix/zizmor-benchmark-job-permissions
Sep 14, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix/zizmor-benchmark-job-permissions

Conversation

@zkochan

@zkochan zkochan commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Summary

checks: write sat at the workflow level of pacquet-integrated-benchmark.yml, granting it to all five jobs. Only report touches GITHUB_TOKEN, in the Bencher upload step, so the grant now lives on that job.

zizmor's excessive-permissions audit flags the workflow-level grant, and it is the only unsuppressed finding in the repository. That matters beyond tidiness: zizmor.yml passes advanced-security: false for fork PRs, because a fork's read-only token cannot upload SARIF to code scanning. With it off the action prints its findings and exits non-zero instead, so this one medium finding fails zizmor latest via PyPI on every fork PR while main stays green. #14795 is the current example.

Verified with zizmor 1.30.1, the version the action installs: over the whole repository the run reports No findings to report with this change, against 1 medium without it.

Only the permission moves; no job's behavior changes.

Squash Commit Body

`checks: write` sat at the workflow level, granting it to all five jobs,
four of which never touch `GITHUB_TOKEN`. Only the report job does, in
the Bencher upload step.

zizmor's excessive-permissions audit flags the workflow-level grant. It
is the one unsuppressed finding in the repository, and because fork PRs
run the zizmor action with `advanced-security` off, the action prints
its findings and exits non-zero instead of uploading SARIF. That turns
the single medium finding into a red check on every fork PR while main
stays green.

Verified with zizmor 1.30.1, the version CI installs: the run over the
repository reports no findings with this change.

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes
    are implemented in every affected version.
  • Added or updated tests.

Written by an agent (Claude Code, claude-opus-5).

🤖 Generated with Claude Code

https://claude.ai/code/session_01PjkYZtr2fTKD4wu3w1GCz4


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Chores
    • Restricted workflow permissions to read-only access by default.
    • Limited check-reporting write access to the reporting job.

`checks: write` sat at the workflow level, granting it to all five jobs,
four of which never touch `GITHUB_TOKEN`. Only the report job does, in
the Bencher upload step.

zizmor's excessive-permissions audit flags the workflow-level grant. It
is the one unsuppressed finding in the repository, and because fork PRs
run the zizmor action with `advanced-security` off, the action prints
its findings and exits non-zero instead of uploading SARIF. That turns
the single medium finding into a red check on every fork PR while main
stays green.

Verified with zizmor 1.30.1, the version CI installs: the run over the
repository reports no findings with this change.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01PjkYZtr2fTKD4wu3w1GCz4
@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 957045f1-44c6-4dfc-95c7-1c8d37b59a05

📥 Commits

Reviewing files that changed from the base of the PR and between 992401c and d90876d.

📒 Files selected for processing (1)
  • .github/workflows/pacquet-integrated-benchmark.yml

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The benchmark workflow removes workflow-wide checks: write access. The report job now declares contents: read and checks: write permissions locally.

Changes

Benchmark workflow permissions

Layer / File(s) Summary
Scope checks-write permission
.github/workflows/pacquet-integrated-benchmark.yml
The workflow-level checks: write permission was removed. The report job now declares contents: read and checks: write permissions.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: ksxgithub

Merge Risk: ⚪ Minimal · up to d9087

The workflow preserves benchmark reporting while limiting checks-write access to the report job, with no remaining merge-blocking risk.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/zizmor-benchmark-job-permissions

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can ask Qodo to dismiss a finding you disagree with, with your reason on record

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Scope benchmark checks permission to the report job

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 5 minutes

Grey Divider

AI Description

• Restricts checks: write to the report job that uploads Bencher results.
• Leaves all other benchmark jobs with read-only repository access.
• Clears zizmor excessive-permissions failures on fork pull requests.
Diagram

graph TD
  W["Benchmark Workflow"] --> G["Contents Read"] --> O["Other Jobs"]
  W --> R["Report Job"] --> P["Read + Checks"] --> B["Bencher Upload"]
Loading
High-Level Assessment

Job-level permission scoping is the optimal least-privilege approach. Splitting the Bencher upload into another job would add workflow complexity without further reducing privileges, while retaining workflow-level access causes zizmor failures and unnecessarily grants write access to unrelated jobs.

Files changed (1) +3 / -1

Other (1) +3 / -1
pacquet-integrated-benchmark.ymlScope checks write access to benchmark reporting +3/-1

Scope checks write access to benchmark reporting

• Removes 'checks: write' from the workflow-level permission block and grants it only to the 'report' job alongside 'contents: read'. This preserves Bencher reporting while preventing unrelated jobs from receiving unnecessary write access.

.github/workflows/pacquet-integrated-benchmark.yml

@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge because the check-publishing job retains its required permission while unrelated jobs lose unnecessary write access.

Reviews (1) · Last reviewed commit: "ci: scope the benchmark workflow's check..."

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan
zkochan merged commit 3271acf into main Sep 14, 2026
29 of 30 checks passed
@zkochan
zkochan deleted the fix/zizmor-benchmark-job-permissions branch September 14, 2026 06:13
zkochan added a commit to Stanzilla/pnpm that referenced this pull request Sep 14, 2026
`just test-pacquet` excludes every pnpr crate, so cargo never builds
`target/debug/pnpr`. `MockInstanceOptions::spawn` runs that binary and
`pnpr_command` asserts it exists, so the new startup-cleanup tests failed
on all three platforms with "pnpr binary not found". An unfiltered
`just test` does build it, which is why a local `just ready` passed.

Move `pnpm-registry-mock` into the `test-pnpr` selection instead: pnpr's
own integration tests force `CARGO_BIN_EXE_pnpr`, so that build writes
the binary before any test runs.

Also drop the `checks: write` grant this branch added to the `benchmark`
job. No step there creates a check run, and pnpm#14879 has since
scoped the permission to `report` on main, so the file now matches main.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013EK4aRsd2brtvY2bBK5gyk
biisal pushed a commit to biisal/pnpm that referenced this pull request Sep 15, 2026
pnpm#14879)

`checks: write` sat at the workflow level, granting it to all five jobs,
four of which never touch `GITHUB_TOKEN`. Only the report job does, in
the Bencher upload step.

zizmor's excessive-permissions audit flags the workflow-level grant. It
is the one unsuppressed finding in the repository, and because fork PRs
run the zizmor action with `advanced-security` off, the action prints
its findings and exits non-zero instead of uploading SARIF. That turns
the single medium finding into a red check on every fork PR while main
stays green.

Verified with zizmor 1.30.1, the version CI installs: the run over the
repository reports no findings with this change.


Claude-Session: https://claude.ai/code/session_01PjkYZtr2fTKD4wu3w1GCz4

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
u9g pushed a commit to u9g/pnpm that referenced this pull request Sep 25, 2026
pnpm#14879)

`checks: write` sat at the workflow level, granting it to all five jobs,
four of which never touch `GITHUB_TOKEN`. Only the report job does, in
the Bencher upload step.

zizmor's excessive-permissions audit flags the workflow-level grant. It
is the one unsuppressed finding in the repository, and because fork PRs
run the zizmor action with `advanced-security` off, the action prints
its findings and exits non-zero instead of uploading SARIF. That turns
the single medium finding into a red check on every fork PR while main
stays green.

Verified with zizmor 1.30.1, the version CI installs: the run over the
repository reports no findings with this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant