Repository navigation
chore: pin all GitHub Actions to commit hashes - #101
Merged
Merged
Conversation
Pin every action to the commit of an exact release, with the exact tag name in a trailing comment. Move the spell check to the same checkout version as the other workflows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
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.
Why
A version tag can move. If the owner of an action, or someone who takes over their account, points a tag at new code, every workflow that uses the tag runs that code on its next run. In 2025, the tags of
tj-actions/changed-fileswere moved this way, and the new code printed CI secrets into the logs.A commit hash can't move. This matters most for
deploy.yml, which will hold the wordpress.org SVN password. WordPress core pins every action the same way, and puts the exact tag name in a trailing comment, as in changeset 62254.Change
Every
uses:line in all 8 workflows now has a full commit hash and the exact tag of that commit:actions/checkoutv7, andv5in spell check3d3c42e5…# v7.0.1actions/setup-nodev7949feb24…# v7.1.0actions/upload-artifactv7cf430e03…# v7.0.2ramsey/composer-installv465e4f849…# 4.0.0shivammathur/setup-phpv2eb7c497e…# 2.40.010up/action-wordpress-plugin-deploy2.3.054bd289b…# 2.3.0crate-ci/typosandwordpress/plugin-check-actionwere already pinned, with exact tags.How I chose each commit:
v7, I took the commit it points to now, then found the release tag that points to that same commit.ramsey/composer-install:v4is a branch, and its latest commit has no release tag. I pinned the4.0.0release, the same commit WordPress core uses.v: two of the exact tags,4.0.0and2.40.0, have nov. That is how those projects name their tags.spell-check.ymlmoves fromactions/checkout@v5to the same pinned v7.0.1 as the other workflows.Updates
Dependabot updates both the hash and the trailing tag comment in its weekly PRs. Review those PRs before merging, because a new hash is new code.
Testing
uses:line is left without a hash.deploy.yml, so it runs every pinned action except the 10up deploy action. That action runs only on a version tag.🤖 Generated with Claude Code