ci: pin GitHub Actions to full-length commit SHAs#128
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
Pin every third-party GitHub Actions reference in
.github/workflows/*.yamlto a full-length commit SHA, with the human-readable tag retained as a trailing comment. Actions are also bumped to their latest stable versions in the process.WHY
The repository's organization policy now requires all actions to be pinned to a full-length commit SHA. Workflows on the current
mainuse floating tag references (@v4,@v5, etc.), so every job fails atSet up jobwith:This blocks CI on every PR (e.g. #127). Pinning to SHAs also mitigates supply chain risk: a compromised maintainer or tag re-point cannot silently change what runs in our pipelines.
HOW
Run
PINACT_MIN_AGE=7 pinact run -uto update each action to the latest release that is at least 7 days old (the cooldown mitigates a freshly published malicious version) and rewrite the reference to<owner>/<action>@<sha> # <version>.Affected workflows:
build.yaml,label-sync.yaml,pages.yaml,pr-labeler.yaml,release.yaml.Notable version bumps included alongside the SHA pinning:
actions/checkoutv4 β v6.0.2actions/setup-gov5 β v6.4.0golangci/golangci-lint-actionv7 β v9.2.1actions/setup-pythonv5 β v6.2.0actions/upload-pages-artifactv3 β v5.0.0actions/deploy-pagesv4 β v5.0.0actions/labelerv5 β v6.1.0goreleaser/goreleaser-actionv6 β v7.2.2Songmu/tagprv1.5.0 β v1.19.0EndBug/label-syncv2 β v2.3.3Schneegans/dynamic-badges-actionv1.7.0 β v1.8.0k1LoW/octocov-actionv1.5.0 β v1.5.1Validation is delegated to CI on this PR: the build/lint/release jobs need to come back green to confirm the major bumps (notably
golangci-lint-actionv7 β v9) do not require workflow changes.