Skip to content

SHA-pin third-party GitHub Actions (#39)#79

Merged
mmcky merged 1 commit into
mainfrom
chore/sha-pin-third-party-actions
Jun 16, 2026
Merged

SHA-pin third-party GitHub Actions (#39)#79
mmcky merged 1 commit into
mainfrom
chore/sha-pin-third-party-actions

Conversation

@mmcky

@mmcky mmcky commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Closes #39 (L18). Pins the third-party actions to full commit SHAs so a hijacked upstream tag can't inject code into our workflows (the threat demonstrated by the tj-actions/changed-files compromise — repointed tags dumped CI secrets). First-party actions/* are left on major tags per GitHub's own guidance, and Dependabot keeps the SHA pins current (it bumps the SHA + the # vN comment).

Pinned (with # vN comment for readability)

Action Files SHA =
docker/login-action build-containers, test-container c94ce9f… # v3
docker/setup-buildx-action build-containers 8d2750c… # v3
docker/metadata-action build-containers c299e40… # v5
docker/build-push-action build-containers ca052bb… # v5
softprops/action-gh-release publish-gh-pages 3bb1273… # v2
conda-incubator/setup-miniconda setup-environment fc2d68f… # v3

Each SHA is what the action's current major tag resolves to today.

Left on major tags (intentional)

actions/checkout, actions/cache, actions/upload-artifact, actions/github-script, actions/configure-pages, actions/upload-pages-artifact, actions/deploy-pages — GitHub-maintained; low hijack risk.

⚠️ Merge-order note

conda-incubator/setup-miniconda is in setup-environment/action.yml, which open PR #78 (#33) also edits. Whichever merges second needs a trivial one-line rebase (re-apply the SHA pin to that uses: line). Suggest merging #78 first, then I rebase this.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings June 16, 2026 08:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Pins third-party GitHub Actions used by this repository’s workflows and composite actions to full commit SHAs to reduce supply-chain risk from upstream tag retargeting, while keeping GitHub-maintained actions/* on major tags.

Changes:

  • Replaced major-tag references with full commit SHAs for docker/* actions in container build/test workflows.
  • SHA-pinned softprops/action-gh-release in publish-gh-pages and conda-incubator/setup-miniconda in setup-environment.
  • Documented the security hardening change in CHANGELOG.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
setup-environment/action.yml SHA-pins conda-incubator/setup-miniconda for non-container setup.
publish-gh-pages/action.yml SHA-pins softprops/action-gh-release for release asset uploads.
.github/workflows/test-container.yml SHA-pins docker/login-action in container test jobs.
.github/workflows/build-containers.yml SHA-pins docker/* actions used to build and push images.
CHANGELOG.md Records the SHA-pinning security change under Unreleased.

Pin third-party actions to full commit SHAs (with a `# vN` comment) so a
hijacked upstream tag can't inject code into our workflows (cf. the
tj-actions/changed-files compromise):
- docker/login-action, docker/setup-buildx-action, docker/metadata-action,
  docker/build-push-action  (build-containers.yml, test-container.yml)
- softprops/action-gh-release  (publish-gh-pages)
- conda-incubator/setup-miniconda  (setup-environment)

First-party actions/* are left on major tags (GitHub-maintained, per GitHub's
guidance). Dependabot's github-actions ecosystem keeps the SHA pins current.

Note: conda-incubator/setup-miniconda is in setup-environment/action.yml, which
open PR #78 (#33) also edits — whichever merges second needs a trivial rebase.

Closes #39

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mmcky mmcky force-pushed the chore/sha-pin-third-party-actions branch from 46da3d6 to e0e9ae9 Compare June 16, 2026 09:33
@mmcky mmcky merged commit 230ea20 into main Jun 16, 2026
@mmcky mmcky deleted the chore/sha-pin-third-party-actions branch June 16, 2026 09:40
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.

Pin third-party actions by full commit SHA

2 participants