ci: isolate benchmark comment permissions#64
Merged
Conversation
Run pull-request workflows with read-only tokens and discard checkout credentials. Publish sanitized benchmark artifacts from trusted default-branch code.
TimBeyer
marked this pull request as ready for review
July 18, 2026 15:03
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
workflow_runworkflowSecurity model
The previous benchmark workflow executed pull-request-controlled dependency lifecycle scripts and benchmark code while its checkout retained the repository token. The repository also inherited a write-capable default token, so a compromised benchmark dependency or competitor could recover that credential.
This change keeps benchmark execution untrusted and read-only. A separate default-branch workflow:
actions: readissues: writeThe publishing job never checks out or executes pull-request code and never receives the artifact filesystem.
The repository setting was also changed out of band to default workflow permissions = read and “Allow GitHub Actions to create and approve pull requests” = disabled, closing the exposed token path immediately.
Validation
npm run formatnpm run lintnpm test— 70 passingnpm run buildgithub-scriptcompilationgit diff --checkA normal
npm cion macOS ARM64/Node 25 reaches the existingv8-profiler-nextnative build failure;npm ci --ignore-scriptssucceeded for local validation.Bootstrap note
This PR itself cannot receive the new benchmark comment: GitHub only runs the privileged
workflow_rundefinition after it exists on the default branch. Benchmark comments begin with subsequent PR runs after merge.