Conversation
Replaces mutable tag/branch references with immutable SHA hashes to prevent supply chain attacks (ref: TeamPCP/Trivy March 2026). Actions left as tags: 0
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
The changes are technically up to Codacy standards, but the review identified critical security and logic flaws that must be addressed before merging.
Specifically, the use of actions/github-script contains a command injection vulnerability due to direct interpolation of event data. Furthermore, the version being pinned (v2) uses a deprecated Node 12 runtime that will lead to workflow failures. A significant logic error was also found in comment_issue.yml where environment variable scoping will cause a key workflow step to be skipped. Finally, inconsistencies between SHA hashes and version comments were detected across several files.
About this PR
- The PR lacks automated validation to ensure the provided SHAs are correct or that the workflows remain functional after pinning. This risk is evidenced by the discovered version mismatch in the script pinning, where SHAs do not align with the version labels in comments.
Test suggestions
- Verify that 'actions/github-script' across all workflow files is pinned to a valid SHA hash.
- Verify that Atlassian Gajira actions (login, create, comment) are pinned to valid SHA hashes.
- Dry-run or execute the workflows to ensure the pinned SHA hashes are accessible and valid.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that 'actions/github-script' across all workflow files is pinned to a valid SHA hash.
2. Verify that Atlassian Gajira actions (login, create, comment) are pinned to valid SHA hashes.
3. Dry-run or execute the workflows to ensure the pinned SHA hashes are accessible and valid.
🗒️ Improve review quality by adding custom instructions
| if: env.JIRA_CREATE_COMMENT_AUTO == 'true' && env.GITHUB_ISSUE_TYPE == 'issue' && env.GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL == 'true' | ||
| id: login | ||
| uses: atlassian/gajira-login@v2.0.0 | ||
| uses: atlassian/gajira-login@90a599561baaf8c05b080645ed73db7391c246ed # v2.0.0 |
There was a problem hiding this comment.
🔴 HIGH RISK
The if condition at line 57 uses env.GITHUB_ISSUE_TYPE and env.GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL. However, environment variables defined within a step's env block are only available to the action execution, not to the if condition. This step will always be skipped. Use step outputs instead: steps.github_issue_type.outputs.result == 'issue' && steps.github_issue_has_jira_issue_label.outputs.result == 'true'.
| 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 |
There was a problem hiding this comment.
🔴 HIGH RISK
There are multiple issues at this location:
- Security: Directly interpolating
${{ toJson(...) }}into thescriptblock allows for arbitrary code execution if malicious input is provided in label names. Pass data viaprocess.envinstead. - Deprecation:
actions/github-script@v2uses Node 12, which has been removed from GitHub runners; this workflow will likely fail. - Inconsistency: The pinned SHA
6e5ee1dc...corresponds tov3.1.0, but the comment indicates# v2.0.0.
Recommendation: Update to v7 (SHA 6010d130245155873297aa385d2a44da1ef0daed) and refactor to pass context data via environment variables.
| if: env.JIRA_CREATE_COMMENT_AUTO == 'true' && env.GITHUB_ISSUE_TYPE == 'issue' && env.GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL == 'true' | ||
| id: extract_jira_number | ||
| uses: actions/github-script@v2.0.0 | ||
| uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0 |
There was a problem hiding this comment.
🟡 MEDIUM RISK
The script at line 79 calls .match(jiraTaskRegex)[1] without verifying that a match was found. If the issue title does not contain the expected Jira ticket pattern, match() will return null and the workflow will crash. Add a check for the existence of the match before accessing the index.
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.