Skip to content

Pin full length commit SHA for 3rd party actions. #1017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

desrosj
Copy link
Member

@desrosj desrosj commented Mar 26, 2025

Proposed changes

This implements the recommendation to pin full length commit SHAs instead of versions or branches when using 3rd-party GitHub Actions to protect from supply chain attacks.

This has been happening more often recently, with a number of popular actions having all of their tags updated with a buried vulnerability.

While the new notation is more verbose, a bit ugly, and requires every update to be applied manually, we can rely on Dependabot to handle that for us to make it more manageable.

No actual updates to actions are happening here. The latest versions correspond with the previous notation used.

Recent examples

Examples of actions being exploited in the wild:

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update
  • Build/Test Tooling update

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

GitHub is looking into providing immutable releases for actions (which would allow versions to be used again), and this is currently in the Q3 2025 roadmap. But we should use full SHA values until then.

See also newfold-labs/workflows#22.

This implements the recommendation to pin full length commit SHAs instead of versions or branches when using 3rd-party GitHub Actions to protect from supply chain attacks.

This has been happening more often recently, with a number of popular actions having all of their tags updated with a buried vulnerability.

While the new notation is more verbose, a bit ugly, and requires every update to be applied manually, we can rely on Dependabot to handle that for us to make it more manageable.
@Copilot Copilot AI review requested due to automatic review settings March 26, 2025 22:13
Copy link

@Copilot 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

This PR updates the GitHub Actions workflows to use full commit SHAs instead of version tags for third-party actions in order to enhance security against supply chain attacks.

  • Replaces version tag references with pinned commit SHAs in multiple workflow files
  • Updates actions including checkout, setup-php, setup-node, cache, and others across various workflows

Reviewed Changes

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

Show a summary per file
File Description
.github/workflows/wp-i18n.yml Pinned commit SHAs for checkout, setup-php, cache, and setup-node actions.
.github/workflows/upload-asset-on-release.yml Pinned commit SHAs for checkout, setup-php, setup-node, cache, and upload-release-asset.
.github/workflows/upload-artifact-on-push.yml Pinned commit SHAs for checkout, setup-php, setup-node, cache, and upload-artifact.
.github/workflows/satis-webhook.yml Pinned repository-dispatch action using a commit SHA.
.github/workflows/lint-yml.yml Pinned commit SHAs for checkout and yamllint actions.
.github/workflows/lint-php.yml Pinned commit SHAs for checkout, setup-php, get-diff, and cache actions.
.github/workflows/cypress-tests.yml Pinned commit SHAs for checkout, setup-php, setup-node, cache, and upload-artifact.
.github/workflows/cypress-tests-beta.yml Pinned commit SHAs for checkout, setup-php, setup-node, cache, and upload-artifact.
.github/workflows/cypress-matrix.yml Pinned commit SHAs for checkout, setup-php, setup-node, cache, and upload-artifact.
.github/workflows/add-to-project.yml Pinned commit SHA for the add-to-project action.

Copy link

cypress bot commented Mar 26, 2025

HostGator Plugin    Run #6049

Run Properties:  status check passed Passed #6049  •  git commit 90533c7c01 ℹ️: Merge 033d7b12b15c37389e86b134140b8c3f306d184e into 184383d3d396b41a64e6ceeb1bd0...
Project HostGator Plugin
Branch Review gha/pin-full-length-shas
Run status status check passed Passed #6049
Run duration 31m 24s
Commit git commit 90533c7c01 ℹ️: Merge 033d7b12b15c37389e86b134140b8c3f306d184e into 184383d3d396b41a64e6ceeb1bd0...
Committer Jonathan Desrosiers
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 29
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 314
View all changes introduced in this branch ↗︎

@desrosj desrosj self-assigned this Mar 27, 2025
@circlecube circlecube merged commit bc0a215 into main Apr 4, 2025
22 checks passed
@circlecube circlecube deleted the gha/pin-full-length-shas branch April 4, 2025 17:43
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