FiveGuesses · v0.1.0
0002. Pin every action and downloaded tool
- Status: accepted
- Date: 2026-10-06
Context
Workflows run third-party code with access to the repository token. A tag such as @v4 can be
moved to different code at any time, and a release download can be replaced. GitHub’s security
guidance calls a full commit SHA the only way to use an action as an immutable release.
Considered options
- Tags (
@v4), updated by hand. - Full commit SHAs with a
# vX.Y.Zcomment, kept current by Dependabot. - Vendoring the actions into the repository.
Decision
Option 2. Every uses: of a remote action or reusable workflow is a 40-character commit SHA with
a version comment; scripts/check_workflows.py fails CI otherwise. Dependabot updates the pins
weekly with a 7-day cooldown. Tools that are downloaded in CI (gitleaks, actionlint) are pinned by
version and sha256 from the vendor’s checksums file; Python tools are installed with
pip --require-hashes. Workflows start from permissions: {}, each job asks only for what it
needs, checkouts do not keep credentials, pull_request_target is never used and no secret is
passed to fork pull requests.
Consequences
- Good: a moved tag or replaced download cannot change what CI runs.
- Good: the organization can turn on “Require actions to be pinned to a full-length commit SHA”.
- Bad: Dependabot pull requests need review, and the downloaded tools need a manual monthly bump.
Not affiliated with or endorsed by Apple. Apple Music and the iTunes Search API are named only to describe where the song previews come from.
docs/adr/0002-pin-actions-and-downloaded-tools.md on GitHub
Licensed under MIT. Source: luminare-dev/FiveGuesses at v0.1.0.