mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-05-21 15:11:22 -05:00
[PR #293] [MERGED] ci: pin third-party GitHub Actions to commit SHAs #3017
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/293
Author: @arunavo4
Created: 5/19/2026
Status: ✅ Merged
Merged: 5/19/2026
Merged by: @arunavo4
Base:
main← Head:ci/pin-actions-to-sha📝 Commits (1)
d687a9aci: pin third-party GitHub Actions to commit SHAs📊 Changes
2 files changed (+11 additions, -11 deletions)
View changed files
📝
.github/workflows/docker-build.yml(+9 -9)📝
.github/workflows/nix-build.yml(+2 -2)📄 Description
Summary
Hardens our CI against the tag-mutation supply-chain attack pattern that recently hit
actions-cool/issues-helperandactions-cool/maintain-one-comment(andtj-actions/changed-filesearlier this year).Threat model: tag refs (
@v3) are mutable. A compromised maintainer can force-movev3to point at malicious code, and every workflow using@v3picks it up on the next run. Theactions-coolpayload read memory fromRunner.Workerto steal credentials and exfiltrated them via HTTPS. Pinning to a 40-char commit SHA makes the ref immutable.This PR covers the highest-risk subset:
nix-build.ymlhad two branch refs (@main) — worse than tags because they move on every push. Pinned to the latest release SHA (v22 / v13).docker-build.ymlis our most secret-bearing workflow (GHCR push token, Docker Hub login, Docker Scout). All five third-party actions there are now SHA-pinned.We're not affected by the current actions-cool incident — neither action is in our chain — but the pattern keeps recurring, so the hygiene matters.
What's not in this PR
actions/checkout,actions/upload-artifact,actions/setup-python,actions/setup-node,actions/github-script,github/codeql-action/*— lower risk (well-resourced GitHub-owned orgs), separate follow-up.oven-sh/setup-bun,azure/setup-helminhelm-test.yml/astro-build-test.yml/e2e-tests.yml— those workflows don't hold publish secrets, also a follow-up.github-actionsecosystem — recommended next so SHA pins still get bumped automatically with the version comment trailer.Test plan
@v3→@<sha> # v3.x.y— no semantic change to workflow behavior, just the refgh api repos/<org>/<repo>/git/ref/tags/<tag>against the latest released tag at time of pindocker-build.ymlsucceeds (validates the SHA pins resolve correctly on GitHub's runners)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.