Skip to content

Pin GitHub Actions to commit SHAs - #1050

Merged
AlfonsoUceda merged 1 commit into
toptal:masterfrom
Totara-thib:pin-actions
Jul 23, 2026
Merged

Pin GitHub Actions to commit SHAs#1050
AlfonsoUceda merged 1 commit into
toptal:masterfrom
Totara-thib:pin-actions

Conversation

@Totara-thib

@Totara-thib Totara-thib commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Hi, small drive-by contribution: this pins the two actions in ruby.yml to their commit shas, with the versions kept as comments.

A tag like @v7 or @v1.319.0 is a movable pointer: whoever controls the action, or anyone who compromises it, can re-point it and your next run executes their code with the job's token. Same pattern as the tj-actions/changed-files incident (CVE-2025-30066). With the sha, what runs is frozen to what you reviewed.

Dependabot keeps working exactly as today: it understands sha pins with a version comment and will keep opening its weekly bump PRs, same as #1049 did.

Both shas were resolved from the upstream repos and cross checked against their tags: checkout 3d3c42e is v7.0.1, setup-ruby 003a5c4 is v1.319.0. No logic changes, only the four uses: lines.

Found with the Plumber CLI (https://github.com/getplumber/plumber), verified on master. I can also open a PR which adds it to CI so this does not quietly drift back, that one is a bonus, this PR stands on its own.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the changelog if the new code introduces user-observable changes. See changelog entry format for details.

Tags like v7 are movable pointers: whoever controls the action can
re-point them and the next run executes unreviewed code with the job
token. Pinning to the commit SHA freezes what runs. Versions stay as
comments, so Dependabot keeps bumping them like it already does.
@Totara-thib
Totara-thib requested a review from a team as a code owner July 22, 2026 15:12

@AlfonsoUceda AlfonsoUceda 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.

Thanks @Totara-thib! fine to me :)

@AlfonsoUceda
AlfonsoUceda merged commit 7616b35 into toptal:master Jul 23, 2026
13 checks passed
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