Skip to content

Pin GitHub Actions to specific commit SHAs (DRIVER-583)#873

Merged
nikagra merged 1 commit intoscylladb:scylla-3.xfrom
nikagra:pin-github-actions-to-sha-3x
Apr 22, 2026
Merged

Pin GitHub Actions to specific commit SHAs (DRIVER-583)#873
nikagra merged 1 commit intoscylladb:scylla-3.xfrom
nikagra:pin-github-actions-to-sha-3x

Conversation

@nikagra
Copy link
Copy Markdown

@nikagra nikagra commented Apr 17, 2026

Summary

Closes DRIVER-583 / part of DRIVER-515.

Replaces all third-party GitHub Action version tags (e.g. @v4, @v5) with immutable full commit SHAs across all 6 workflow files on the scylla-3.x branch. This reduces the supply chain attack surface: mutable tags can be silently redirected to malicious code, while a pinned SHA is permanent.

Pinned versions

Action Version SHA
actions/checkout v4.3.1 34e114876b0b11c390a56381ad16ebd13914f8d5
actions/checkout v5.0.1 93cb6efe18208431cddfb8368fd83d5badbf9bfd
actions/setup-java v5.2.0 be666c2fcd27ec809703dec50e508c2fdc7f6654
actions/setup-python v5.6.0 a26af69be951a213d495a4c3e4e4022e16d87065
actions/setup-python v6.2.0 a309ff8b426b58ec0e2a45f0f869d46889d02405
actions/cache (restore/save) v4.3.0 0057852bfaa89a56745cba8c7296529d2fc39830
actions/upload-artifact v4.6.2 ea165f8d65b6e75b540449e92b4886f43607fa02
mikepenz/action-junit-report v5.6.2 3585e9575db828022551b4231f165eb59a0e74e3
dorny/test-reporter v1 3eeb9fc888e82e8be2fb356bbeec2750231672bc

Note: two actions have different versions across files (docs workflows use older checkout@v4 / setup-python@v5 while the tests workflow uses @v5 / @v6). Both are pinned to their respective SHAs without upgrading versions.

Files changed

  • .github/workflows/docs-pages.yaml
  • .github/workflows/docs-pr.yaml
  • .github/workflows/release.yml
  • .github/workflows/tests@v1.yml
  • .github/workflows/tests-reports@v1.yml
  • .github/workflows/tests-reports-4x@v1.yml
  • CONTRIBUTING.md — added section explaining how to update pinned actions in the future

Required follow-up (manual, needs repo admin)

Update Settings -> Actions -> General -> Allow or block specified actions and reusable workflows to allowlist the pinned SHAs:

actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5,
actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd,
actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654,
actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065,
actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405,
actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830,
actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02,
mikepenz/action-junit-report@3585e9575db828022551b4231f165eb59a0e74e3,
dorny/test-reporter@3eeb9fc888e82e8be2fb356bbeec2750231672bc

Reference implementation: scylladb/nodejs-rs-driver#430

Copy link
Copy Markdown

Copilot AI left a comment

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 in this repository’s workflows to immutable commit SHAs to reduce supply-chain risk, and documents how to maintain those pins going forward.

Changes:

  • Replace mutable uses: ...@v* action references with full commit SHAs (with inline version comments) across the updated workflows.
  • Add contributor documentation describing the pinning rationale and update procedure (including allowlist/update steps).

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
CONTRIBUTING.md Adds guidance on why/how workflow action SHAs are pinned and how to update them.
.github/workflows/tests@v1.yml Pins all referenced actions (checkout, setup-java/python, cache restore/save, upload-artifact, junit report) to full SHAs.
.github/workflows/tests-reports@v1.yml Pins dorny/test-reporter to a specific SHA.
.github/workflows/tests-reports-4x@v1.yml Pins dorny/test-reporter to a specific SHA for the 4.x reports workflow.
.github/workflows/release.yml Pins checkout/setup-java/upload-artifact actions to full SHAs.
.github/workflows/docs-pr.yaml Pins checkout/setup-python/setup-java actions to full SHAs for docs PR builds.
.github/workflows/docs-pages.yaml Pins checkout/setup-python/setup-java actions to full SHAs for docs publishing.

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

Comment thread CONTRIBUTING.md Outdated
Replace all third-party action version tags (e.g. @v4, @v5) with
immutable commit SHAs to reduce supply chain attack surface. Version
tags are mutable and can be redirected to malicious code; SHAs are
permanent.

The pinned versions are:
  actions/checkout             v4.3.1  34e114876b0b11c390a56381ad16ebd13914f8d5
  actions/checkout             v5.0.1  93cb6efe18208431cddfb8368fd83d5badbf9bfd
  actions/setup-java           v5.2.0  be666c2fcd27ec809703dec50e508c2fdc7f6654
  actions/setup-python         v5.6.0  a26af69be951a213d495a4c3e4e4022e16d87065
  actions/setup-python         v6.2.0  a309ff8b426b58ec0e2a45f0f869d46889d02405
  actions/cache (restore/save) v4.3.0  0057852bfaa89a56745cba8c7296529d2fc39830
  actions/upload-artifact      v4.6.2  ea165f8d65b6e75b540449e92b4886f43607fa02
  mikepenz/action-junit-report v5.6.2  3585e9575db828022551b4231f165eb59a0e74e3
  dorny/test-reporter          v1      3eeb9fc888e82e8be2fb356bbeec2750231672bc

Also adds a section to CONTRIBUTING.md explaining how to safely update
pinned actions in the future (find SHA for tag, verify no impostor
commit, update workflow files and repo settings allowlist).

Closes: DRIVER-583

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@nikagra nikagra force-pushed the pin-github-actions-to-sha-3x branch from a638dd1 to 0ffdf00 Compare April 22, 2026 11:57
@nikagra nikagra merged commit 4c22d90 into scylladb:scylla-3.x Apr 22, 2026
11 checks passed
@nikagra nikagra deleted the pin-github-actions-to-sha-3x branch April 22, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants