ci: pin GitHub Actions to full-length commit SHAs#101
Conversation
Pin all action references to full-length commit SHAs for supply chain security. This is required for the org-level policy: 'Require actions to be pinned to a full-length commit SHA'. Original version tags are preserved as comments for readability.
📝 WalkthroughWalkthroughThis PR updates the GitHub Actions CI workflow to pin all external actions to specific commit SHAs instead of version tags. Changes affect ChangesCI Workflow Action Pinning
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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/CI.yml:
- Line 15: The workflow pins actions/setup-java to the commit SHA
be666c2fcd27ec809703dec50e508c2fdc7f6654 which is actually a v6 update despite
the comment saying v5; fix by making the pin and comment consistent: either
update the action reference to the v6 tag (e.g., actions/setup-java@v6 or the
correct v6 SHA) or replace the SHA with the true v5 release commit and adjust
the comment, ensuring the actions/setup-java@be666c2f... reference and its
accompanying comment both match the intended major version.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 503c2c69-a95b-4e63-98d7-15418a2c8c36
📒 Files selected for processing (1)
.github/workflows/CI.yml
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | ||
| - name: Set up JDK 21 | ||
| uses: actions/setup-java@v5 | ||
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify actions/setup-java SHA corresponds to v5
echo "Checking actions/setup-java SHA..."
gh api repos/actions/setup-java/commits/be666c2fcd27ec809703dec50e508c2fdc7f6654 --jq '{sha: .sha, message: .commit.message}' || echo "SHA not found"
echo -e "\nChecking v5 tag..."
gh api repos/actions/setup-java/git/ref/tags/v5 --jq '.object.sha' || echo "v5 tag not found"Repository: jbangdev/jbang-eclipse
Length of output: 348
The SHA pin corresponds to a v6 commit, not v5.
The SHA be666c2fcd27ec809703dec50e508c2fdc7f6654 is tagged as v5 in the actions/setup-java repository, but its commit message explicitly states "Chore: Version Update and Checkout Update to v6 (#973)". Either the tag is incorrect, the comment should reference v6, or the pinned commit should be updated to the actual v5 release commit.
🤖 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/CI.yml at line 15, The workflow pins actions/setup-java to
the commit SHA be666c2fcd27ec809703dec50e508c2fdc7f6654 which is actually a v6
update despite the comment saying v5; fix by making the pin and comment
consistent: either update the action reference to the v6 tag (e.g.,
actions/setup-java@v6 or the correct v6 SHA) or replace the SHA with the true v5
release commit and adjust the comment, ensuring the
actions/setup-java@be666c2f... reference and its accompanying comment both match
the intended major version.
Pin all action references to full-length commit SHAs for supply chain security.
This is required for enabling the org-level policy:
Require actions to be pinned to a full-length commit SHA
Original version tags are preserved as comments for readability.
Consider adding Dependabot for GitHub Actions to keep pins updated:
Summary by CodeRabbit