Repository navigation
chore: tighten GitHub Actions permissions - #36330
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/release.yml" line_range="96" />
<code_context>
runs-on: depot-ubuntu-24.04-arm
permissions:
- contents: write
+ contents: read
issues: write
pull-requests: write
</code_context>
<issue_to_address>
**Release cleanup still gets write access**
When a release run reaches the cleanup job and has a release branch to delete, the `cleanup` job still grants `contents: write` and persists the default `GITHUB_TOKEN` in its checkout, then uses it to delete the release branch. That leaves a release job writing with the workflow token rather than the deploy token, contrary to the stated permission reduction.
Use `RELEASE_DEPLOY_TOKEN` for the cleanup checkout and branch deletion, and reduce that job’s `contents` permission to `read`.
</issue_to_address>
### Comment 2
<location path=".github/actions/setup-bun/action.yml" line_range="11-13" />
<code_context>
version:
description: Bun version, keep in sync with the pinned claude-code-action
default: 1.4.4
+ sha256:
+ description: Checksum of bun-linux-x64.zip for that version, from the release's SHASUMS256.txt
+ default: bf8ccbfb2b0b80159e0f9a6d15c55317add8077534dbc6130a3edb52fccb395c
outputs:
</code_context>
<issue_to_address>
**Bun setup fails for version overrides**
When a caller overrides `version` but leaves `sha256` at its default, `sha256sum -c` compares the downloaded archive for the selected version against the default 1.4.4 digest and exits nonzero, so setup fails before Bun is installed.
Make the checksum match the selected version or require callers to provide a matching checksum when overriding `version`.
Also at `.github/actions/setup-bun/action.yml:45`.
</issue_to_address>
1 of 2 tasks
Member
|
Dunno… |
Member
Author
|
Ok, merge and see/fix if something breaks. |
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.
Reduces the workflow token permissions to what each job uses and cleans up related findings of the OpenSSF Scorecard. The repository default for workflow tokens is now read-only.
permissions: {}in all workflows that had noneactions: writefrom the build jobs and their nightly and release callerscontents: read, it writes with the deploy tokenTODO
actions: write/backport: confirm it works with the read-only token🤖 Generated with Claude Code