Skip to content

Security: pin GitHub Actions to SHA hashes#9

Merged
afsmeira merged 1 commit intomasterfrom
security/pin-actions-to-sha
Apr 17, 2026
Merged

Security: pin GitHub Actions to SHA hashes#9
afsmeira merged 1 commit intomasterfrom
security/pin-actions-to-sha

Conversation

@jorgebraz
Copy link
Copy Markdown

Pins all GitHub Actions from mutable tags/branches to immutable SHA hashes.

This prevents supply chain attacks like the TeamPCP/Trivy incident (March 2026), where attackers force-pushed tags to point at malicious commits.

Auto-generated by the Codacy security audit script.

Replaces mutable tag/branch references with immutable SHA hashes
to prevent supply chain attacks (ref: TeamPCP/Trivy March 2026).

Actions left as tags: 0
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes. Give us feedback

Copy link
Copy Markdown

@codacy-production codacy-production bot left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR successfully implements the security requirement of pinning GitHub Actions to immutable SHA hashes. While the code is technically 'up to standards' according to Codacy, the review identified a regression in .github/workflows/auto-merge.yml where the pinned SHA points to an outdated version (v1.1.1) instead of the v1.6.0 version currently in use via tags. Furthermore, the actions/checkout usage in .github/workflows/codeql.yml relies on the deprecated Node.js 16 runtime. Addressing these versioning concerns is necessary to maintain workflow reliability.

Test suggestions

  • Verify dependabot/fetch-metadata in auto-merge.yml is pinned to a SHA hash.
  • Verify actions/checkout in codeql.yml is pinned to a SHA hash.
  • Verify github/codeql-action steps (init, autobuild, analyze) in codeql.yml are pinned to SHA hashes.

🗒️ Improve review quality by adding custom instructions

- name: Fetch Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
uses: dependabot/fetch-metadata@8348ea7f5d949b08c7f125a44b569c9626b05db3 # v1
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

The hash 8348ea7f5d949b08c7f125a44b569c9626b05db3 pins the action to version v1.1.1. Since the workflow previously used the @v1 tag (resolving to v1.6.0), this change introduces a regression. It is recommended to pin to the latest stable release for that major version to avoid reintroducing resolved issues.\n\nsuggestion\n uses: dependabot/fetch-metadata@c9c4182bf1b97f5224a132144d9358cd1d819911 # v1.6.0\n

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ LOW RISK

Suggestion: The actions/checkout@v3 action is powered by Node.js 16, which is deprecated. Upgrading to v4 ensures compatibility with the Node.js 20 runtime environment.\n\nsuggestion\n uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7\n

@afsmeira afsmeira merged commit 44d1845 into master Apr 17, 2026
4 checks passed
@afsmeira afsmeira deleted the security/pin-actions-to-sha branch April 17, 2026 11:13
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