Skip to content

chore: pin all GitHub Actions to commit hashes - #101

Merged
mukeshpanchal27 merged 1 commit into
trunkfrom
chore/pin-actions
Nov 4, 2026
Merged

mukeshpanchal27 merged 1 commit into
trunkfrom
chore/pin-actions

Conversation

@mukeshpanchal27

Copy link
Copy Markdown
Owner

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-files were 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:

Action Was Pinned to Released
actions/checkout v7, and v5 in spell check 3d3c42e5… # v7.0.1 2026-07-20
actions/setup-node v7 949feb24… # v7.1.0 2026-10-08
actions/upload-artifact v7 cf430e03… # v7.0.2 2026-10-07
ramsey/composer-install v4 65e4f849… # 4.0.0 2026-03-15
shivammathur/setup-php v2 eb7c497e… # 2.40.0 2026-10-08
10up/action-wordpress-plugin-deploy 2.3.0 54bd289b… # 2.3.0 2025-01-21

crate-ci/typos and wordpress/plugin-check-action were already pinned, with exact tags.

How I chose each commit:

  • Moving tags: for a tag such as v7, I took the commit it points to now, then found the release tag that points to that same commit.
  • ramsey/composer-install: v4 is a branch, and its latest commit has no release tag. I pinned the 4.0.0 release, the same commit WordPress core uses.
  • Tags without a v: two of the exact tags, 4.0.0 and 2.40.0, have no v. That is how those projects name their tags.
  • Age: every release is at least two weeks old.
  • Spell check: spell-check.yml moves from actions/checkout@v5 to 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

  • All 8 workflow files parse as YAML.
  • No uses: line is left without a hash.
  • CI on this PR runs every workflow except 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

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>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@mukeshpanchal27
mukeshpanchal27 merged commit c102cdd into trunk Nov 4, 2026
14 checks passed
@mukeshpanchal27
mukeshpanchal27 deleted the chore/pin-actions branch November 19, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant