Skip to content

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:06
Copy link
Contributor

@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 GitHub Actions workflow files to pin full-length commit SHAs for third-party actions to improve security.

  • Updated the commit SHA for peter-evans/repository-dispatch in satis-update.yml
  • Updated the commit SHAs for actions/checkout, shivammathur/setup-php, technote-space/get-diff-action, and actions/cache in lint.yml

Reviewed Changes

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

File Description
.github/workflows/satis-update.yml Updated repository-dispatch action to use a full commit SHA
.github/workflows/lint.yml Updated several actions to use full commit SHAs
Comments suppressed due to low confidence (1)

.github/workflows/lint.yml:31

  • The comment above indicates that PHP 7.4 is required for compatibility with WordPress codesniffer rules, but 'php-version' is set to '7.3'. Consider updating the php-version to 7.4 or adjusting the comment to ensure consistency.
php-version: '7.3'

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