Skip to content

ci: pin third-party actions to commit SHAs#5865

Merged
greysonlalonde merged 3 commits into
mainfrom
chore/pin-actions-to-sha
May 20, 2026
Merged

ci: pin third-party actions to commit SHAs#5865
greysonlalonde merged 3 commits into
mainfrom
chore/pin-actions-to-sha

Conversation

@greysonlalonde

@greysonlalonde greysonlalonde commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Pins every third-party action across .github/workflows/ to a full commit SHA (e.g. astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6) instead of a mutable version tag.
  • Mitigates supply-chain risk from a tag being moved to a malicious commit.

Test plan

  • Tag comments preserved next to each SHA so version bumps stay reviewable.
  • Workflows re-run on this PR to confirm pinned SHAs resolve.

Note

Low Risk
Low-risk CI-only change that pins third-party actions for reproducible builds; primary risk is workflow breakage if any pinned SHA is incorrect or removed.

Overview
Hard-pins third-party GitHub Actions across CI workflows (tests/lint/type-check/nightly/publish/vulnerability scan/etc.) from mutable tags (e.g. @v6) to specific commit SHAs with version comments for auditability.

Also swaps the tool-specs workflow’s GitHub App token step from tibdex/github-app-token@v2 to actions/create-github-app-token@v3.2.0 (updating input names accordingly), and pins the Slack notification action to a commit SHA.

Reviewed by Cursor Bugbot for commit 025cb62. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Chores
    • Pin third-party GitHub Actions to fixed commit versions across CI workflows (tests, linting, nightly builds, publishing, PR checks, vulnerability scans, etc.) to improve reproducibility and stability of automated pipelines.

Review Change Stack

Replaces version tags (e.g. astral-sh/setup-uv@v6, slackapi/slack-github-action@v2.1.0)
with full commit SHAs across every workflow. Mitigates supply-chain risk from
mutable tags.
@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Workflow files replace floating action tags with pinned commit SHAs (and update one GitHub App token action's input keys). Step logic and other job configuration are unchanged.

Changes

GitHub Actions SHA Pinning

Layer / File(s) Summary
Pin astral-sh/setup-uv across workflows
.github/workflows/build-uv-cache.yml, .github/workflows/generate-tool-specs.yml, .github/workflows/linter.yml, .github/workflows/nightly.yml, .github/workflows/publish.yml, .github/workflows/tests.yml, .github/workflows/type-checker.yml, .github/workflows/update-test-durations.yml, .github/workflows/vulnerability-scan.yml
astral-sh/setup-uv uses: references replaced from floating @v* tags to specific commit SHAs; existing step with inputs remain the same.
Pin dorny/paths-filter in change-detection jobs
.github/workflows/linter.yml, .github/workflows/tests.yml, .github/workflows/type-checker.yml
dorny/paths-filter uses: references replaced from @v3 to specific commit SHAs; filter configuration unchanged.
Pin remaining third-party actions & update inputs
.github/workflows/generate-tool-specs.yml, .github/workflows/pr-size.yml, .github/workflows/pr-title.yml, .github/workflows/publish.yml
GitHub App token action replaced with actions/create-github-app-token pinned to a SHA and with keys renamed (app_idapp-id, private_keyprivate-key); codelytv/pr-size-labeler, amannn/action-semantic-pull-request, and slackapi/slack-github-action are pinned to commit SHAs without changing step inputs.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 From branches of YAML I hop and sing,

I pin each action to a tiny ring,
No drifting tags across the CI sea,
Anchored commits keep builds repeatably free,
A carrot-coded nod to stability. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'ci: pin third-party actions to commit SHAs' directly and clearly summarizes the main change across all modified workflow files.
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 Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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 chore/pin-actions-to-sha

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/generate-tool-specs.yml:
- Line 25: Replace the archived action reference
"tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a" with a
maintained alternative such as "actions/create-github-app-token@v1" (pin to a
stable tag or SHA), and update the step's inputs/outputs to match the new
action's contract (adjust any "with:" keys, outputs consumed later in the job,
and required permissions or secrets) so the workflow still receives the same
token value; verify and update subsequent steps that reference the old action's
output name to the new action's output name.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 942ee6a4-a67c-4e8c-98ab-0a8e4e95b42b

📥 Commits

Reviewing files that changed from the base of the PR and between da15554 and fb6930d.

📒 Files selected for processing (11)
  • .github/workflows/build-uv-cache.yml
  • .github/workflows/generate-tool-specs.yml
  • .github/workflows/linter.yml
  • .github/workflows/nightly.yml
  • .github/workflows/pr-size.yml
  • .github/workflows/pr-title.yml
  • .github/workflows/publish.yml
  • .github/workflows/tests.yml
  • .github/workflows/type-checker.yml
  • .github/workflows/update-test-durations.yml
  • .github/workflows/vulnerability-scan.yml

Comment thread .github/workflows/generate-tool-specs.yml Outdated
greysonlalonde and others added 2 commits May 20, 2026 01:42
…ub-app-token

The tibdex action is archived. Switches to the maintained
actions/create-github-app-token (pinned to v3.2.0 SHA) and renames
the inputs from app_id/private_key to app-id/private-key. The token
output name is unchanged, so downstream references continue to work.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/generate-tool-specs.yml (1)

25-28: ⚡ Quick win

Explicitly scope the GitHub App token to the current repository.

The action has default scoping, but declaring owner and repositories explicitly improves security posture by following the principle of least privilege and avoiding reliance on implicit defaults.

Suggested hardening
       - name: Generate GitHub App token
         id: app-token
         uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
         with:
           app-id: ${{ secrets.CREWAI_TOOL_SPECS_APP_ID }}
           private-key: ${{ secrets.CREWAI_TOOL_SPECS_PRIVATE_KEY }}
+          owner: ${{ github.repository_owner }}
+          repositories: |
+            ${{ github.event.repository.name }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/generate-tool-specs.yml around lines 25 - 28, Add explicit
repo-scoping to the GitHub App token step to avoid default wide scope: in the
step that uses
actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1,
include the inputs "owner" (use github.repository_owner) and "repositories" (use
github.repository or the specific repo name) alongside the existing app-id and
private-key entries so the generated token is limited to the current repository.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/generate-tool-specs.yml:
- Around line 25-28: Add explicit repo-scoping to the GitHub App token step to
avoid default wide scope: in the step that uses
actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1,
include the inputs "owner" (use github.repository_owner) and "repositories" (use
github.repository or the specific repo name) alongside the existing app-id and
private-key entries so the generated token is limited to the current repository.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ee9e099a-7179-407c-9ec5-9f12b4189597

📥 Commits

Reviewing files that changed from the base of the PR and between fb6930d and 993fdf0.

📒 Files selected for processing (1)
  • .github/workflows/generate-tool-specs.yml

@greysonlalonde
greysonlalonde merged commit 14af56b into main May 20, 2026
56 checks passed
@greysonlalonde
greysonlalonde deleted the chore/pin-actions-to-sha branch May 20, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants