Repository navigation
ci: run pull request checks with a read-only token and re-pin the toolchain action - #91
Merged
Merged
Conversation
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 changed
.github/workflows/ci.ymlonly.release-please.ymlcarries the same toolchain pin and is handled separately.Read-only token. The workflow now declares
permissions: contents: readat the top level, so the format, clippy, test, Windows version-resource and MSRV jobs, and the third-party actions they run, get a read-onlyGITHUB_TOKENinstead of the repository default. The Advisories job alone addschecks: write, whichrustsec/audit-checkdocuments as the permission it needs to report the advisories as a check run. It keepscontents: readfor the checkout, since a job-level block replaces the top-level one.dtolnay/rust-toolchainre-pinned. The old pin4cda84d5was a 2026-07-16 head of the action'sstablebranch. That branch is rebased onto everymastercommit, so the SHA is no longer reachable from any branch (compare againststableshows it diverged, 14 ahead and 1 behind), Dependabot cannot move it because# stable branchis not a version, and it predates upstream dtolnay/rust-toolchain#187 ("Safely handle action inputs"). Both uses now pine2a55d2f, the merge commit of #187 and the current head ofmaster, with the comment# master, 2026-10-09. This is the same pin and the same reasoning astemplates/sign-and-publish-caller.ymland the CI of Project-Colony-Resources. Amasterpin has no default toolchain, so the check job now passestoolchain: stable; the MSRV job already passes its own toolchain. Like the template, this pin is bumped by hand.Swatinem/rust-cachere-pinned. The old pinf0d9c388was commented# v2but was the head ofmaster, 5 commits past the v2 release. It now pins6323deb1, the commit bothv2andv2.9.2point to, commented# v2.9.2, so the Dependabotgithub-actionsentry can bump the SHA and the version comment together.Verification
gh api repos/dtolnay/rust-toolchain/branches/masterpoints ate2a55d2f; itsaction.ymlrequires thetoolchaininput, which both steps now set.gh api repos/Swatinem/rust-cache/git/ref/tags/v2.9.2is an annotated tag whose object is commit6323deb1; tagv2resolves to the same commit.permissionsare{contents: read}at the top and{contents: read, checks: write}on the Advisories job.uses:line in.github/workflows/is pinned to a 40-character SHA with a trailing comment.