Skip to content

ci: pin third-party GitHub Actions to commit SHAs#372

Merged
mdickinson merged 1 commit into
mainfrom
ci-pin-actions-to-shas
Jul 8, 2026
Merged

ci: pin third-party GitHub Actions to commit SHAs#372
mdickinson merged 1 commit into
mainfrom
ci-pin-actions-to-shas

Conversation

@mdickinson

Copy link
Copy Markdown
Member

Summary

Hardens CI supply-chain security by pinning all external GitHub Actions to immutable commit SHAs instead of mutable version tags, and adds a Dependabot cooldown. This mirrors enthought/envisage#604.

Why

A uses: owner/repo@v6 reference resolves through a mutable git tag. If an attacker compromises an action's repository — or just gains the ability to move a tag — they can retarget v6 at malicious code, and every workflow pinned to that tag runs it on the next CI run, with access to that job's secrets. This is what happened in the March 2025 tj-actions/changed-files compromise, where version tags were retroactively moved to a commit that exfiltrated CI secrets. Full-SHA pins are immutable, so each run is reproducible and immune to tag-move attacks. Follows GitHub's security-hardening guidance.

Changes

  • Pin all external actions to commit SHAs with a trailing version comment:

    Action SHA Version
    actions/checkout df4cb1c v6.0.3
    actions/setup-python ece7cb0 v6.3.0
    actions/cache 55cc834 v6.1.0
    enthought/setup-edm-action e68a4e0 v4.2
  • Add a 7-day Dependabot cooldown (cooldown: default-days: 7) so action updates aren't picked up until they've been published for a week, reducing exposure to a compromised release that gets yanked shortly after publication.

Dependabot continues to maintain the SHA pins, bumping both the SHA and the version comment. The pinned versions match what apptools already used (checkout/setup-python/cache v6, setup-edm-action v4.2); this change is functionally a no-op beyond the pinning itself.

🤖 Generated with Claude Code

Pin all external GitHub Actions to immutable commit SHAs (with a trailing
version comment) rather than mutable version tags, following GitHub's
security-hardening guidance. A mutable tag such as @v6 can be retargeted at
malicious code if the action's repository is compromised (as in the March
2025 tj-actions/changed-files incident); a full commit SHA is immutable, so
each run is reproducible and immune to tag-move attacks.

Also add a 7-day Dependabot cooldown so action updates aren't picked up until
they have been published for a week. Dependabot continues to maintain the
pins, bumping both the SHA and the version comment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mdickinson

Copy link
Copy Markdown
Member Author

Self-merging. We only use official GitHub Actions in this repository, so the actual risk is low; this is more about establishing the convention.

@mdickinson
mdickinson merged commit 204e6fe into main Jul 8, 2026
25 checks passed
@mdickinson
mdickinson deleted the ci-pin-actions-to-shas branch July 8, 2026 08:35
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