Skip to content

chore: pin GitHub Actions to commit SHAs - #261

Merged
nikosxenakis merged 7 commits into
mainfrom
chore/pin-actions-to-sha
Apr 13, 2026
Merged

chore: pin GitHub Actions to commit SHAs#261
nikosxenakis merged 7 commits into
mainfrom
chore/pin-actions-to-sha

Conversation

@slawomirbabicz

Copy link
Copy Markdown
Contributor

Pin GitHub Actions to commit SHAs

GitHub Actions referenced by tag (e.g. actions/checkout@v4) use a mutable pointer — the tag owner can move it to a different commit at any time, including a malicious one. This is the attack vector used in the tj-actions/changed-files incident (CVE-2025-30066).

Pinning to a full 40-character commit SHA makes the reference immutable. The # tag comment preserves human readability so reviewers can tell which version is pinned.

Important: a SHA can also originate from a forked repository. A malicious actor can fork an action, push a compromised commit to the fork, and the SHA will resolve — but it won't exist in the upstream canonical repo. Each SHA in this PR was verified against the action's canonical repository (not a fork).

Changes

  • actions/checkout@v4 -> actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

  • dfinity/ci-tools/.github/workflows/check-pr-title.yaml@main -> dfinity/ci-tools/.github/workflows/check-pr-title.yaml@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • dfinity/ci-tools/.github/workflows/check-commit-messages.yaml@main -> dfinity/ci-tools/.github/workflows/check-commit-messages.yaml@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • actions/create-github-app-token@v1 -> actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0

  • dfinity/ci-tools/actions/setup-python@main -> dfinity/ci-tools/actions/setup-python@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • dfinity/ci-tools/actions/setup-commitizen@main -> dfinity/ci-tools/actions/setup-commitizen@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • dfinity/ci-tools/actions/setup-pnpm@main -> dfinity/ci-tools/actions/setup-pnpm@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • dfinity/ci-tools/actions/bump-version@main -> dfinity/ci-tools/actions/bump-version@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • dfinity/ci-tools/actions/create-pr@main -> dfinity/ci-tools/actions/create-pr@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • oven-sh/setup-bun@v2 -> oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0

  • dfinity/ci-tools/.github/workflows/generate-changelog.yaml@main -> dfinity/ci-tools/.github/workflows/generate-changelog.yaml@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • dfinity/ci-tools/actions/is-beta-tag@main -> dfinity/ci-tools/actions/is-beta-tag@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • dfinity/ci-tools/actions/generate-release-notes@main -> dfinity/ci-tools/actions/generate-release-notes@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • dfinity/ci-tools/actions/extract-version@main -> dfinity/ci-tools/actions/extract-version@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • dfinity/ci-tools/actions/assemble-docs@main -> dfinity/ci-tools/actions/assemble-docs@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

  • dfinity/ci-tools/actions/submit-docs@main -> dfinity/ci-tools/actions/submit-docs@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main

Files modified

  • .github/workflows/check-spec-drift.yml
  • .github/workflows/commitizen.yml
  • .github/workflows/create-release-pr.yml
  • .github/workflows/e2e-test-nodejs.yml
  • .github/workflows/generate-changelog.yml
  • .github/workflows/lint.yml
  • .github/workflows/release.yml

@slawomirbabicz
slawomirbabicz requested a review from a team as a code owner April 9, 2026 15:41
Copilot AI review requested due to automatic review settings April 9, 2026 15:41

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

This PR improves GitHub Actions supply-chain security by replacing tag-based action references (mutable) with full 40-character commit SHAs (immutable), while keeping the original tag/branch noted in comments for readability.

Changes:

  • Pinned actions/checkout, actions/create-github-app-token, and oven-sh/setup-bun to commit SHAs.
  • Pinned all referenced dfinity/ci-tools reusable workflows and composite actions from @main to a specific commit SHA.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/check-spec-drift.yml Pins actions/checkout to an immutable commit SHA.
.github/workflows/commitizen.yml Pins reusable dfinity/ci-tools workflows to an immutable commit SHA.
.github/workflows/create-release-pr.yml Pins checkout, app-token, and dfinity/ci-tools actions to immutable commit SHAs.
.github/workflows/e2e-test-nodejs.yml Pins checkout, pnpm setup, and bun setup actions to immutable commit SHAs.
.github/workflows/generate-changelog.yml Pins reusable changelog workflow reference to an immutable commit SHA.
.github/workflows/lint.yml Pins checkout and pnpm setup actions to immutable commit SHAs.
.github/workflows/release.yml Pins several dfinity/ci-tools actions and the main checkout step to immutable commit SHAs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml
@nikosxenakis
nikosxenakis added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit e3edbdc Apr 13, 2026
22 of 24 checks passed
@nikosxenakis
nikosxenakis deleted the chore/pin-actions-to-sha branch April 13, 2026 08:19
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.

3 participants