chore: harden actions trust boundaries - #2788
Merged
Merged
Conversation
banteg
force-pushed
the
ci/actions-hardening
branch
from
May 12, 2026 08:50
65a1185 to
4f45d3f
Compare
|
This pull request is considered stale because it has been open 30 days with no activity. Remove stale label, add a comment, or make a new commit, otherwise this PR will be closed in 5 days. |
fubuloubu
force-pushed
the
ci/actions-hardening
branch
from
June 12, 2026 12:49
4f45d3f to
8ef9db2
Compare
fubuloubu
enabled auto-merge (squash)
June 12, 2026 12:49
fubuloubu
approved these changes
Jun 12, 2026
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.
What
Harden GitHub Actions trust boundaries after the recent Mini Shai-Hulud/GitHub Actions supply-chain activity.
This does not reduce test coverage. It keeps PR checks intact while separating untrusted PR execution from jobs that can publish packages, push container images, request OIDC tokens, or write repository contents.
Changes
contents: readandid-token: write, and stop restoring the setup-uv cache in that publish path.docsruns for pull requests withcontents: read.publish-docsruns for push/release events withcontents: write, preserving the gh-pages publish path.buildjobs are read-only and usepr-...cache scopes.publishjobs keep GHCR/attestation/OIDC permissions and usetrusted-...cache scopes.Why
The main risk is not
pull_request_targethere; Ape does not use it. The remaining low-hanging hardening is avoiding shared trust between PR jobs and publish jobs:Validation
pre-commit run --files .github/workflows/build.yaml .github/workflows/docs.yaml .github/workflows/publish.yaml .github/workflows/test.yamlruby -e 'require "yaml"; Dir[".github/workflows/*.{yml,yaml}"].each { |f| YAML.load_file(f); puts "ok #{f}" }'git diff --check