Skip to content

Pin GitHub Actions to commit SHAs - #27

Closed
henrybear327 wants to merge 1 commit into
sysprog21:mainfrom
henrybear327:ci/pin-action-shas
Closed

henrybear327 wants to merge 1 commit into
sysprog21:mainfrom
henrybear327:ci/pin-action-shas

Conversation

@henrybear327

@henrybear327 henrybear327 commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Improve CI security.

Every action was referenced by a floating major tag such as actions/checkout@v6. Such a tag is mutable, so whoever controls the action repository can repoint it at new code, which then runs in the release job with contents: write and pushes tags. A commit SHA cannot be repointed.

The release version stays in a trailing comment so the reference is still readable, and so Dependabot can rewrite the SHA and the comment together.


Summary by cubic

Pin all GitHub Actions in .github/workflows/main.yml to commit SHAs and upgrade to current majors to harden CI. This removes mutable tags, reduces supply-chain risk, and keeps readable version comments so Dependabot can auto-update.

  • Dependencies
    • actions/checkout pinned to 3d3c42e5aac5ba805825da76410c181273ba90b1 (v7.0.1)
    • actions/cache pinned to 55cc8345863c7cc4c66a329aec7e433d2d1c52a9 (v6.1.0)
    • actions/upload-artifact pinned to 043fb46d1a93c77aae656e7c1c64a875d1fc6a0a (v7.0.1)
    • actions/download-artifact pinned to 3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c (v8.0.1)
    • softprops/action-gh-release pinned to 3d0d9888cb7fd7b750713d6e236d1fcb99157228 (v3.0.2)

Written for commit 9991939. Summary will update on new commits.

Review in cubic

Every action was referenced by a floating major tag such as
actions/checkout@v6. Such a tag is mutable, so whoever controls the
action repository can repoint it at new code, which then runs in the
release job with contents: write and pushes tags. A commit SHA cannot
be repointed.

The release version stays in a trailing comment so the reference is
still readable, and so Dependabot can rewrite the SHA and the comment
together.

Move to the current majors in the same pass: checkout v6 to v7.0.1 and
cache v5 to v6.1.0, both ESM and dependency refreshes. The new checkout
v7 restriction on fork pull request checkout applies only to
pull_request_target and workflow_run, which this workflow does not use.
@jserv

jserv commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Don't do that. The deliverables are not security-oriented, so always use shorter, simpler notation.

@jserv jserv closed this Aug 6, 2026
@henrybear327
henrybear327 deleted the ci/pin-action-shas branch August 7, 2026 13:17
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.

2 participants