Skip to content

Security: pin GitHub Actions to SHA hashes - #24

Merged
afsmeira merged 1 commit into
masterfrom
security/pin-actions-to-sha
Mar 25, 2026
Merged

Security: pin GitHub Actions to SHA hashes#24
afsmeira merged 1 commit into
masterfrom
security/pin-actions-to-sha

Conversation

@jorgebraz

Copy link
Copy Markdown
Contributor

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

Alerts:

"

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

@codacy-production codacy-production 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.

Pull Request Overview

This PR successfully implements the security practice of pinning GitHub Actions to immutable SHA hashes. However, a significant discrepancy exists across all three workflows: the SHA hash provided for 'actions/github-script' corresponds to version 3.0.0, while the accompanying comments and intent suggest version 2.0.0. This version jump includes breaking changes (such as an Octokit upgrade) that may cause workflow failures. Codacy analysis indicates the PR is up to standards with no new quality or complexity issues detected.

About this PR

  • There is a systemic mismatch between the pinned SHAs and the version comments for 'actions/github-script'. The current SHA (6e5ee1d...) points to v3.0.0, while the intention appears to be v2.0.0. Using v3.0.0 may introduce breaking changes into the automation pipeline.

Test suggestions

  • Verify that actions/github-script uses the correct SHA for v2.0.0 across all relevant files.
  • Verify that atlassian/gajira-login uses the correct SHA for v2.0.0 across all relevant files.
  • Verify that atlassian/gajira-comment uses the correct SHA for v2.0.2.
  • Verify that atlassian/gajira-create uses the correct SHA for v2.0.1.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that actions/github-script uses the correct SHA for v2.0.0 across all relevant files.
2. Verify that atlassian/gajira-login uses the correct SHA for v2.0.0 across all relevant files.
3. Verify that atlassian/gajira-comment uses the correct SHA for v2.0.2.
4. Verify that atlassian/gajira-create uses the correct SHA for v2.0.1.

🗒️ Improve review quality by adding custom instructions

- name: Change Title
if: github.event.label.name == env.JIRA_ISSUE_LABEL
uses: actions/github-script@v2.0.0
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0

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 pinned SHA corresponds to v3.0.0, mismatching the v2.0.0 comment. Use the correct SHA for v2.0.0.

Suggested change
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0
uses: actions/github-script@24874c9354964e7c7a3641198f3956461c37b30c # v2.0.0

- name: Update GitHub issue
if: env.JIRA_CREATE_ISSUE_AUTO == 'true'
uses: actions/github-script@v2.0.0
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0

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 pinned SHA corresponds to v3.0.0, mismatching the v2.0.0 comment. Use the correct SHA for v2.0.0.

Suggested change
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0
uses: actions/github-script@24874c9354964e7c7a3641198f3956461c37b30c # v2.0.0

if: env.JIRA_CREATE_COMMENT_AUTO == 'true'
id: github_issue_type
uses: actions/github-script@v2.0.0
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0

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 pinned SHA corresponds to v3.0.0, while the comment specifies v2.0.0. To maintain the version used previously, use the correct SHA for v2.0.0.

Suggested change
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0
uses: actions/github-script@24874c9354964e7c7a3641198f3956461c37b30c # v2.0.0

@afsmeira
afsmeira merged commit 7d3f96f into master Mar 25, 2026
4 checks passed
@afsmeira
afsmeira deleted the security/pin-actions-to-sha branch March 25, 2026 10:24
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