Skip to content

chore: pin GitHub Action dependencies to commit SHAs (SDLC-1165) - #3

Open
casper-phantom[bot] wants to merge 2 commits into
mainfrom
casper/sdlc-1165-pin-github-actions
Open

chore: pin GitHub Action dependencies to commit SHAs (SDLC-1165)#3
casper-phantom[bot] wants to merge 2 commits into
mainfrom
casper/sdlc-1165-pin-github-actions

Conversation

@casper-phantom

@casper-phantom casper-phantom Bot commented Aug 4, 2026

Copy link
Copy Markdown

Closes SDLC-1165

Note

Low risk: CI-only change to two workflow files; the pinned SHAs were resolved from the upstream v4.4.0 tags and both workflows run on every pull request, so a bad pin surfaces immediately in this PR's own checks.

Summary

  • Pins actions/checkout and actions/setup-node in main.yml and tests.yml to 40-character commit SHAs, so a moved tag or compromised upstream can no longer change CI code without a change in this repository.
  • Both pins land on v4.4.0 rather than freezing the v3 refs the workflows used, because pinning fixes the ref permanently and v3 is built on the deprecated Node 16 runtime.
  • The remaining uses: ./ steps run the action in this repository and are already immutable at the checked-out commit, so no recursive references are left unpinned.
  • Also sets persist-credentials: false on both checkout steps, so the yarn install in the test workflow no longer has a token sitting in .git/config for a dependency lifecycle script to read. No step needs git authentication: nothing pushes, fetches, or clones, the action authenticates through Octokit with the token input, and yarn.lock has no git+ dependencies.

casper-run-id: 019fcd81-039c-7c08-936f-f78e69eb8190

Summary by CodeRabbit

  • Chores
    • Improved CI workflow reliability and security by pinning build and test actions to specific versioned commits.
    • Updated checkout and Node.js setup steps to use version 4.4.0.
    • Disabled persisted checkout credentials to reduce unnecessary credential exposure during workflow runs.

Both workflows resolved actions/checkout and actions/setup-node through
mutable v3 tags, so a moved tag or compromised upstream could change CI
code without a change in this repository. Pin both to 40-character SHAs.

Pinning also fixes the ref in place, so the pins land on v4.4.0 rather
than freezing the Node 16 based v3 runtime.

- actions/checkout -> 11d5960a326750d5838078e36cf38b85af677262 (v4.4.0)
- actions/setup-node -> 49933ea5288caeca8642d1e84afbd3f7d6820020 (v4.4.0)

The remaining uses: ./ steps reference the action in this repository and
are already immutable at the checked-out commit.

Co-authored-by: casper-phantom <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The GitHub workflows replace floating v3 action tags with pinned v4.4.0 commits. The main workflow also disables persisted checkout credentials.

Changes

GitHub Actions pinning

Layer / File(s) Summary
Pin workflow actions
.github/workflows/main.yml, .github/workflows/tests.yml
The workflows pin actions/checkout to a v4.4.0 commit. The main workflow sets persist-credentials to false. The test workflow also pins actions/setup-node to a v4.4.0 commit.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the primary change: pinning GitHub Action dependencies to commit SHAs.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch casper/sdlc-1165-pin-github-actions

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

@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/main.yml:
- Line 11: Disable checkout credential persistence by adding
persist-credentials: false to both checkout steps: .github/workflows/main.yml
line 11 and .github/workflows/tests.yml line 13. No Git authentication is
required, so apply the same setting to each actions/checkout invocation.
🪄 Autofix

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

Run ID: bb958961-18a3-4b74-836d-64cb73bd3070

📥 Commits

Reviewing files that changed from the base of the PR and between 91737fc and d7ef55d.

📒 Files selected for processing (2)
  • .github/workflows/main.yml
  • .github/workflows/tests.yml

Comment thread .github/workflows/main.yml
actions/checkout leaves its token in .git/config by default, so any
repository-controlled command running after checkout can read it. The
test workflow runs yarn and yarn test, which makes that token reachable
by dependency lifecycle scripts.

No step needs git authentication after checkout: nothing pushes,
fetches, or clones, the action reaches GitHub through Octokit with the
token passed explicitly as an input, and yarn.lock has no git
dependencies. Reported by zizmor as artipacked.


Co-authored-by: casper-phantom <[email protected]>
@casper-phantom
casper-phantom Bot marked this pull request as ready for review August 4, 2026 17:22
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.

2 participants