Skip to content

chore(ci): pin third-party GitHub Actions to commit SHAs#3631

Merged
saddlepaddle merged 2 commits into
mainfrom
pin-actions
Apr 22, 2026
Merged

chore(ci): pin third-party GitHub Actions to commit SHAs#3631
saddlepaddle merged 2 commits into
mainfrom
pin-actions

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Apr 22, 2026

Summary

  • Replaces every mutable tag (@v4, @v2, @master, @1.3.0, …) on third-party actions with the commit SHA it currently resolves to, leaving a trailing # <tag> comment so Dependabot/Renovate can still find and bump them.
  • 114 uses: references pinned across 13 workflow files. Zero logic changes — line counts net to ±0 (114 ins / 114 del).
  • Local ./.github/... references are intentionally left as-is.

Why

Closes Tolmo findings:

  • 04e0e887 critical — APPLE signing secrets via build-desktop.yml
  • 3580d63d critical — VERCEL_TOKEN via deploy-production.yml
  • 3ced71b1 high — FLY_API_TOKEN
  • 59691bf4 high — BETTER_AUTH_SECRET
  • ce908e26 high — ANTHROPIC_API_KEY
  • f7d7ab2e high — GH_WEBHOOK_SECRET
  • 8bd4a7ba medium — QSTASH_TOKEN + signing keys
  • 6ab1fc7e medium — SLACK_CLIENT_SECRET + SLACK_SIGNING_SECRET

All eight findings share the same root cause: a maintainer-account compromise of an unpinned action (notably oven-sh/setup-bun@v2, also superfly/flyctl-actions/setup-flyctl@master) would execute attacker code in our deploy/build jobs and exfiltrate every secret listed above. Pinning to a SHA blocks that path.

Resolved SHAs

Action Was Now
actions/checkout v4 / v5 34e1148… / 93cb6ef…
oven-sh/setup-bun v2 0c5077e…
actions/cache v4 0057852…
actions/setup-node v5 a0853c2…
actions/upload-artifact v4 / v5 ea165f8… / 330a01c…
actions/download-artifact v4 / v5 d3f86a1… / 634f93c…
softprops/action-gh-release v2 3bb1273…
neondatabase/delete-branch-action v3 4468d82…
neondatabase/create-branch-action v6 fb620d4…
superfly/flyctl-actions/setup-flyctl master ed8efb3…
superfly/fly-pr-review-apps 1.3.0 f7152c1…
thollander/actions-comment-pull-request v3 24bffb9…

Follow-up (not in this PR)

The same Tolmo findings call out the secondary issue: every workflow runs with the default GITHUB_TOKEN scope (contents: write + others). Adding a top-level permissions: { contents: read } block per workflow with per-job overrides where needed (release jobs, PR comment jobs, etc.) is a separate change.

Test plan

  • CI green on this PR (lint / typecheck / test / build)
  • deploy-preview runs successfully on this PR — confirms oven-sh/setup-bun, actions/cache, actions/upload-artifact, actions/download-artifact, neondatabase/create-branch-action, superfly/fly-pr-review-apps, thollander/actions-comment-pull-request all still resolve at the pinned SHAs
  • After merge, watch deploy-production on main succeed end-to-end (confirms superfly/flyctl-actions/setup-flyctl@<sha> still works)
  • After merge, next release-desktop run still creates a release (confirms softprops/action-gh-release@<sha>)

Summary by cubic

Pin all third‑party GitHub Actions to commit SHAs to harden CI/CD. No logic changes; 114 references updated across 13 workflows. Local ./.github/... actions are unchanged. Closes eight Tolmo findings related to unpinned actions and secret exfiltration risk.

  • Dependencies
    • Replaced mutable tags with SHAs and added trailing comments with exact release tags (e.g., # v4.3.1, # v2.2.0, # 1.6) so Dependabot/Renovate can show real version bumps.
    • Pinned key actions: actions/checkout, actions/cache, actions/upload-artifact, actions/download-artifact, actions/setup-node, oven-sh/setup-bun, neondatabase/create-branch-action, neondatabase/delete-branch-action, superfly/flyctl-actions/setup-flyctl, superfly/fly-pr-review-apps, softprops/action-gh-release, thollander/actions-comment-pull-request.

Written for commit f5af8f0. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Pinned third‑party CI/CD action references to specific commit SHAs across pipeline workflows.
    • No workflow commands, inputs, artifact names/paths, or runtime behavior were changed; end‑user functionality remains unchanged.

Replaces every mutable tag (`@v4`, `@v2`, `@master`, etc.) on third-party
actions with the commit SHA they currently resolve to, with a trailing
`# <tag>` comment so Dependabot/Renovate can keep them updated.

Closes Tolmo findings 04e0e887, 3580d63d, 3ced71b1, 59691bf4, ce908e26,
f7d7ab2e, 8bd4a7ba, 6ab1fc7e — all rooted in the unpinned
`oven-sh/setup-bun@v2` (and other tags) reachable from
`deploy-production.yml` and `build-desktop.yml`.

114 references pinned across 13 workflow files. No logic changes.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

GitHub Actions workflows across the repository were updated to pin external action references to specific commit SHAs instead of floating major version tags. Changes affect checkout, Bun setup, caching, artifact, and deployment actions across multiple workflow files; no step logic or inputs were modified.

Changes

Cohort / File(s) Summary
Workflow files (version pinning)
/.github/workflows/build-cli.yml, /.github/workflows/build-desktop.yml, /.github/workflows/bump-homebrew.yml, /.github/workflows/ci.yml, /.github/workflows/cleanup-preview.yml, /.github/workflows/deploy-preview.yml, /.github/workflows/deploy-production.yml, /.github/workflows/generate-changelog.yml, /.github/workflows/release-desktop-canary.yml, /.github/workflows/release-desktop.yml, /.github/workflows/setup-automations-schedule.yml, /.github/workflows/triage-issue.yml, /.github/workflows/update-docs.yml
Replaced floating action version tags with pinned commit SHAs for third-party GitHub Actions (e.g., actions/checkout, oven-sh/setup-bun, actions/cache, actions/upload-artifact, actions/download-artifact, Fly/other actions). No changes to step with: inputs, run: commands, artifact names/paths, conditions, or control flow.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 I hop through hashes, tidy and bright,
I pin each action with careful delight,
No drifting tags left to roam,
Workflows now anchored, safe at home,
A carrot-coded build—what a sight! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: pinning third-party GitHub Actions to commit SHAs for security hardening across CI/CD workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description comprehensively covers all required sections: clear summary, related issues (Tolmo findings), type of change (refactor/hardening), test plan, and additional context.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pin-actions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 22, 2026

Greptile Summary

This PR pins all 114 third-party GitHub Actions uses: references across 13 workflow files from mutable version tags (@v4, @v2, @master, @1.3.0) to their corresponding immutable commit SHAs, with trailing # <tag> comments to keep Dependabot/Renovate able to detect and propose updates. It is a pure security hardening change with zero logic modifications.

Key changes:

  • All 12 unique third-party actions now reference full 40-character commit SHAs, blocking supply-chain attacks that would be possible if any action maintainer's account were compromised
  • A grep for remaining uses:.*@ references without SHA pins returns zero results — coverage is complete
  • The superfly/flyctl-actions/setup-flyctl comment correctly uses the more informative # master @ 2026-04-21 convention, since master is a branch (not a stable tag) and the date documents when the SHA was resolved
  • Local ./.github/... composite action references are intentionally and correctly left as relative paths (they resolve from the repository's own tree and are unaffected by external compromise)
  • A follow-up item noted in the PR description — adding permissions: { contents: read } top-level blocks to each workflow — is not addressed here but is the right next step to further reduce blast radius

Confidence Score: 5/5

This PR is safe to merge immediately — it is a pure security improvement with no logic changes and complete coverage of all 114 third-party action references.

All third-party uses: references have been pinned with consistent SHAs across every file, trailing tag comments are present for Dependabot/Renovate compatibility, and a post-change grep confirms zero remaining unpinned references. There are no logic changes, so regression risk is negligible.

No files require special attention. All 13 workflow files are mechanically correct and internally consistent.

Important Files Changed

Filename Overview
.github/workflows/deploy-production.yml Pins 7 action references (checkout, setup-bun, cache, setup-node, flyctl-actions) to SHAs; highest-priority file given VERCEL_TOKEN and FLY_API_TOKEN exposure risk noted in Tolmo findings
.github/workflows/build-desktop.yml Pins 5 action references (checkout, setup-bun, cache, upload-artifact x3) to SHAs; critical given Apple signing secrets exposure risk
.github/workflows/deploy-preview.yml Pins 13 action references across 6 jobs covering checkout, setup-bun, cache, create-branch-action, upload-artifact, download-artifact, fly-pr-review-apps, and actions-comment-pull-request
.github/workflows/cleanup-preview.yml Pins delete-branch-action, flyctl-actions/setup-flyctl (with informative # master @ 2026-04-21 comment), and actions-comment-pull-request
.github/workflows/ci.yml Pins checkout, setup-bun, and cache across 5 jobs; no issues
.github/workflows/release-desktop-canary.yml Pins checkout, download-artifact, and softprops/action-gh-release; only workflow file using action-gh-release (release-desktop.yml uses gh CLI instead)
.github/workflows/build-cli.yml Pins checkout@v5, setup-bun, setup-node, upload-artifact@v5, and download-artifact@v5 — uses v5 action variants consistently
.github/workflows/bump-homebrew.yml Pins single checkout@v5 reference; all other steps use shell scripts with no external actions
.github/workflows/release-desktop.yml Pins checkout@v4 and download-artifact@v4; uses gh release create CLI (not softprops action) so no additional action pinning needed
.github/workflows/generate-changelog.yml Pins checkout, setup-bun, and cache; no issues
.github/workflows/setup-automations-schedule.yml Pins checkout, setup-bun, and cache; no issues
.github/workflows/triage-issue.yml Pins checkout, setup-bun, and cache; no issues
.github/workflows/update-docs.yml Pins checkout, setup-bun, and cache; no issues

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Third-party Action referenced\nby mutable tag e.g. @v2] -->|Before this PR| B{Maintainer account\ncompromised?}
    B -->|Yes| C[Attacker pushes malicious\ncode to tag]
    C --> D[CI job runs attacker code\nin trusted context]
    D --> E[Secrets exfiltrated\nVERCEL_TOKEN, FLY_API_TOKEN,\nANTHROPIC_API_KEY, etc.]
    B -->|No| F[Normal execution]

    A2[Third-party Action referenced\nby immutable SHA e.g. @ed8efb3...] -->|After this PR| G{Maintainer account\ncompromised?}
    G -->|Yes| H[Attacker pushes malicious\ncode to tag]
    H --> I[SHA still resolves to\noriginal safe commit]
    I --> J[Normal execution\nattack blocked]
    G -->|No| J
Loading

Reviews (1): Last reviewed commit: "chore(ci): pin third-party GitHub Action..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 13 files

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ✅ Electric Fly.io app

Thank you for your contribution! 🎉

Replaces major-tracking comments (`# v4`, `# v2`, `# master`) with the
precise release tag the SHA points to (`# v4.3.1`, `# v2.2.0`, `# 1.6`).
Same SHAs, more useful comments — Dependabot/Renovate can now show
"v4.3.1 → v4.4.0" in the bump PR title instead of a no-op `v4 → v4`.
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