Skip to content

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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

desrosj
Copy link

@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:16
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 multiple GitHub Actions workflow files to use full-length commit SHAs instead of version tags or branch names, in line with enhanced security practices.

  • Replaces version-based references with immutable commit SHAs for various actions.
  • Aims to mitigate risks from supply chain attacks by pinning dependencies.

Reviewed Changes

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

File Description
.github/workflows/publish-package.yml Updated checkout and setup-node actions with pinned commit SHAs to ensure immutability.
.github/workflows/npm-publish.yml Updated checkout and setup-node actions with pinned commit SHAs for consistent security.
.github/workflows/satis-update.yml Updated repository-dispatch action to use a full-length commit SHA for improved reliability.
.github/workflows/lint-checker-php.yml Replaced version tags with full-length commit SHAs for checkout, setup-php, get-diff-action, and cache actions.

@desrosj desrosj self-assigned this Mar 27, 2025
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.

1 participant