Skip to content

workflows: Pin GitHub Actions to commit hashes - #1065

Merged
jtrobles-cdd merged 1 commit into
developfrom
claude/github-actions-pin-versions-4aaa56
Sep 14, 2026
Merged

jtrobles-cdd merged 1 commit into
developfrom
claude/github-actions-pin-versions-4aaa56

Conversation

@jtrobles-cdd

Copy link
Copy Markdown
Member

A Git tag is mutable, so actions/checkout@v7.0.1 resolves to whatever commit the tag points at when the workflow runs, and an account takeover or a compromised release is enough to move it. These workflows hold the credentials that publish the package to the package registry, so code substituted that way would run with them. codecov/codecov-action was already referenced by commit hash, and nothing else was.

Scope

  • Every reference to a third-party Action now carries the full commit hash with the friendly version in a trailing comment, in the same form codecov/codecov-action already used.
  • No version changes: each hash is the one the tag already in use resolves to, so the Actions that run are the same ones that ran before.
  • The reusable workflows of cordada/github-actions-utils keep referencing @master, as they are internal to the organization and the branch is the reference the callers are meant to track.
  • The ./.github/workflows/*.yaml calls in ci-cd.yaml are same-repository references and take no version.

Dependabot

  • .github/dependabot.yml needs no change: Dependabot updates a hash reference the same way it updates a tag, and rewrites the comment along with it, as long as the friendly version follows the hash as a comment. That is the form used here.

How the hashes were obtained

  • Each one comes from the GitHub API for the tag already in use, dereferencing an annotated tag to the commit it points at. Applying the same method to codecov-action@v7.0.0 reproduces the hash already committed for it, which is how the method was checked.

Not verified

  • The YAML linter that gates this repository is Super-Linter, run through a reusable workflow, and it was not run locally. What was checked instead is that all eight workflow files still parse and that no changed line exceeds the 100-character limit of .editorconfig.

- Reference every third-party GitHub Action by the full commit hash of the version already in use,
  with that version in a trailing comment, as `codecov/codecov-action` was already referenced.
- A Git tag is mutable, so `actions/checkout@v7.0.1` resolves to whatever commit the tag points at
  when the workflow runs, and an account takeover or a compromised release is enough to replace it
  with code of somebody's choosing. This repository's workflows hold the credentials that publish
  the package to the registry, so that code would run with them.
- Dependabot keeps hash references up to date the same way it keeps tag references up to date, as
  long as the friendly version follows the hash as a comment, so the `github-actions` ecosystem
  entry in `.github/dependabot.yml` needs no change.
- Reusable workflows of `cordada/github-actions-utils` are left referencing `master`, as they are
  internal to the organization and the branch is the reference the callers are meant to track.
@jtrobles-cdd
jtrobles-cdd requested a review from a team as a code owner September 14, 2026 15:21
@jtrobles-cdd jtrobles-cdd added task Task or chore component: config config, setup, etc topic: security labels Sep 14, 2026
@jtrobles-cdd jtrobles-cdd self-assigned this Sep 14, 2026
@sonarqubecloud

Copy link
Copy Markdown

@jtrobles-cdd
jtrobles-cdd merged commit 40d40d7 into develop Sep 14, 2026
28 checks passed
@jtrobles-cdd
jtrobles-cdd deleted the claude/github-actions-pin-versions-4aaa56 branch September 14, 2026 15:26
@svillegas-cdd svillegas-cdd mentioned this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: config config, setup, etc task Task or chore topic: security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant