Skip to content

security(ci): pin third-party GitHub Actions to commit SHAs#801

Merged
BYK merged 1 commit intomasterfrom
security/pin-third-party-actions
Apr 21, 2026
Merged

security(ci): pin third-party GitHub Actions to commit SHAs#801
BYK merged 1 commit intomasterfrom
security/pin-third-party-actions

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 21, 2026

Summary

Pins every third-party GitHub Action used in Craft's own CI to a full commit SHA, with the semver retained as a trailing comment for human reviewers. Protects against tag-hijacking (compromised maintainer account, malicious force-push to a tag, or an intentional-turned-hostile maintainer) without losing the readability of "what version am I on?" at a glance.

Changes

Two third-party actions touched, 6 usages total across 3 workflow files:

Action Old New
pnpm/action-setup @v4 @b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
rossjrw/pr-preview-action @v1 @ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1.8.1

Files: .github/workflows/build.yml, .github/workflows/docs-preview.yml, .github/workflows/lint.yml.

Scope — what's not pinned and why

  • actions/* (checkout, setup-node, cache, upload-artifact, create-github-app-token): GitHub-owned, trust root, out of scope for this pass.
  • getsentry/* (craft@v2, local reusable workflows, local ./ action): same-org, separate trust boundary, out of scope.
  • getsentry/action-enforce-license-compliance: already SHA-pinned to 4fae092d42cc91cdfa447eb5b0987cbecfdb07c6 — no change needed.

Verification

  • python3 -c "import yaml; ..." parses all 7 workflow files cleanly.
  • grep post-change shows only SHA-pinned references for both third-party actions.
  • SHAs resolved via git ls-remote <repo> 'v4^{}' 'v1^{}' (authoritative deref of annotated tag objects to the commits). Both match the current tip of the respective v<N> floating tags.

Tag-pointer drift from here on is visible in the diff when anyone bumps these references in a future PR.

`uses: action@v1` style references resolve to whatever commit the tag
currently points at. Tag ownership is shared with the action
maintainer, so a compromise of their account (or a malicious
maintainer move) can silently rewrite the tag to point at a hostile
commit without any change to our workflow files. The industry-standard
mitigation is to pin every non-trusted action to a full commit SHA and
keep the semver as a trailing comment for humans.

Pin the two third-party actions used in Craft's workflows:

- pnpm/action-setup@b906aff # v4.3.0
  (build.yml x3, docs-preview.yml x1, lint.yml x1)
- rossjrw/pr-preview-action@ffa7509 # v1.8.1
  (docs-preview.yml x1)

Left unpinned by design:
- actions/* (GitHub-owned; trust root).
- getsentry/* (same org; separate trust boundary from third-party).
- Local ./ and local reusable workflows (path-based, no tag drift).

getsentry/action-enforce-license-compliance was already SHA-pinned.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-04-21 19:52 UTC

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 93befdb. Configure here.

Comment thread .github/workflows/build.yml
@BYK BYK merged commit d1b73b7 into master Apr 21, 2026
17 checks passed
@BYK BYK deleted the security/pin-third-party-actions branch April 21, 2026 19:51
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