Merged
Conversation
Co-authored-by: jaseel0 <225665919+jaseel0@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix potential issue with unpinned actions in workflows
Pin GitHub Actions to full commit SHAs
Feb 26, 2026
naheel0
approved these changes
Feb 26, 2026
jaseel0
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mutable version tags (
@v3,@v5,@v7) are vulnerable to tag takeover — a compromised upstream account can silently redirect a tag to malicious code. Pinning to immutable commit SHAs eliminates this vector and ensures reproducible builds.Changes
.github/workflows/nodejs.ymlactions/checkout@v3→@f43a0e5...(v3.6.0)actions/setup-node@v3→@5e21ff4...(v3.8.1).github/workflows/labeler.ymlactions/labeler@v5→@8558fd7...(v5.0.0).github/workflows/issue-labeler.ymlactions/github-script@v7→@f28e40c...(v7.1.0)Each SHA is annotated with a version comment for readability:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/actions/checkout/git/ref/tags/v3/usr/bin/curl curl -s REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>⚠️ Potential issue | 🟠 Major</issue_title>⚠️ Potential issue | 🟠 Major
<issue_description>
🧩 Analysis chain
🏁 Script executed:
Repository: BeyteFlow/errlens
Length of output: 1181
🏁 Script executed:
Repository: BeyteFlow/errlens
Length of output: 465
🌐 Web query:
GitHub Actions security best practices SHA pinning supply chain security💡 Result:
GitHub Actions supply-chain security best practices (with SHA pinning)
1) Pin every third‑party action to a full commit SHA
uses:—a full-length commit SHA is the most reliable way to avoid a tag/branch later being moved to malicious code. Add a comment with the human version for readability (and to help Dependabot updates). [1]2) Prefer SHAs that correspond to a tagged release you trust
3) Watch out for “unpinnable” behavior (mutable dependencies)
4) Enforce SHA pinning (org/enterprise policy)
5) Minimize token permissions (least privilege)
permissions:forGITHUB_TOKENat workflow/job level, granting only what’s required. [4]6) Prefer short‑lived cloud credentials via OIDC (avoid long‑lived secrets)
7) Prevent workflow/script injection
run:scripts, unsafe expression usage). This is called out as a key hardening item. [1]Sources: GitHub Well‑Architected Actions security guidance [1], GitHub Docs on
GITHUB_TOKENpermissions [4] and OIDC hardening [5], GitHub Changelog on SHA pinning enforcement and blocking [3], and security research on “unpinnable actions” [2].Pin all GitHub Actions to full commit SHAs.
Lines 27, 30, 35, and 38 use mutable version tags (
@v4,@v3). Pinning to 40-character commit SHAs prevents tag takeover attacks and ensures reproducible, verifiable builds.🔒 Suggested hardening diff
📝 Committable suggestion