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
This PR successfully addresses the security requirement of pinning GitHub Actions to immutable commit SHAs across all workflows. However, the review identified several critical issues within the modified files that should be addressed before merging to ensure reliability and full security hardening.
Major concerns include asynchronous API calls that are not awaited, which will cause non-deterministic behavior in issue syncing, and a regex implementation lacking null-safety. Additionally, while the PR improves security by pinning actions, the workflows continue to use direct expression interpolation in github-script blocks, which remains a vector for injection attacks. Addressing these logic and security gaps is recommended to complement the pinning of actions.
About this PR
- A recurring pattern of missing
awaitkeywords on asynchronous Octokit calls was found across all three workflow files. This will lead to race conditions where actions terminate before API requests complete. - While pinning actions to SHAs is a significant security improvement, several workflows continue to use direct expression interpolation (${{ ... }}) inside
github-scriptblocks. This pattern is vulnerable to script injection if the context values are manipulated. It is highly recommended to transition these to environment variables as part of this security-focused PR.
Test suggestions
- Verify all instances of 'actions/github-script' are pinned to SHA 6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45
- Verify all instances of 'atlassian/gajira-login' are pinned to SHA 90a599561baaf8c05b080645ed73db7391c246ed
- Verify 'atlassian/gajira-comment' is pinned to SHA 8ec356b5df49f1325653db7ee2da2b59a1d78203
- Verify all instances of 'atlassian/gajira-create' are pinned to SHA c0a9c69ac9d6aa063fed57201e55336ada860183
🗒️ 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 |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Asynchronous API calls should be awaited to ensure the action does not terminate prematurely. Add await to the github.issues.update and github.issues.createComment calls.
Try running the following prompt in your coding agent:
Add
awaitto all asynchronous GitHub API calls in.github/workflows/create_issue_on_label.yml.
| - 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 |
There was a problem hiding this comment.
🟡 MEDIUM RISK
The asynchronous calls to github.issues.update and github.issues.addLabels are not awaited. This can cause the action to finish before the API requests are completed. Add the await keyword to all asynchronous Octokit calls.
Try running the following prompt in your coding agent:
Update the
github-scriptblocks in.github/workflows/create_issue.ymlto await allgithub.issuesAPI calls.
| 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 regex match result is accessed directly without a null check. This will cause the workflow to fail if the issue title doesn't match the Jira pattern (e.g. for bot comments or unrelated issues). Consider adding a check for the match result before accessing index 1.
Try running the following prompt in your coding agent:
In
.github/workflows/comment_issue.yml, update theExtract Jira numberscript to safely handle cases where the regex match might be null.
| - name: Add comment after sync | ||
| if: github.event.label.name == env.JIRA_ISSUE_LABEL | ||
| uses: actions/github-script@v2.0.0 | ||
| uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0 |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Suggestion: Avoid direct interpolation in the script at line 81. Use environment variables to pass steps.create_jira_issue.outputs.issue and secrets.JIRA_BASE_URL into the script context.
Try running the following prompt in your IDE agent:
In
.github/workflows/create_issue_on_label.yml, update theAdd comment after syncstep to passsteps.create_jira_issue.outputs.issueandsecrets.JIRA_BASE_URLas environment variables.
| - name: Add comment after sync | ||
| if: env.JIRA_CREATE_ISSUE_AUTO == 'true' | ||
| uses: actions/github-script@v2.0.0 | ||
| uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0 |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Suggestion: Directly interpolating values into the script string (line 89) is less secure than using environment variables. To follow best practices and maintain consistency with other parts of the workflow, pass these values via the env block.
Try running the following prompt in your IDE agent:
In
.github/workflows/create_issue.yml, update theAdd comment after syncstep to passsteps.create_jira_issue.outputs.issueandsecrets.JIRA_BASE_URLas environment variables.
| if: env.JIRA_CREATE_COMMENT_AUTO == 'true' | ||
| id: github_issue_has_jira_issue_label | ||
| uses: actions/github-script@v2.0.0 | ||
| uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0 |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Suggestion: Accessing github.event.issue.labels via direct interpolation is risky. It should be passed via env to avoid potential code injection.
Try running the following prompt in your IDE agent:
In
.github/workflows/comment_issue.yml, update theCheck if GitHub Issue has JIRA_ISSUE_LABELstep to passgithub.event.issue.labelsas a JSON string in an environment variable, then parse it usingJSON.parse(process.env.LABELS)inside the script.
| 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.
🟡 MEDIUM RISK
Suggestion: While pinning actions to SHAs is a great security improvement, the script on line 26 still uses direct interpolation of the GitHub context. This can be vulnerable to injection attacks if the context values (like issue data) are manipulated. Use environment variables instead.
Try running the following prompt in your IDE agent:
In
.github/workflows/comment_issue.yml, update theCheck GitHub Issue typestep to passgithub.event.issue.pull_requestas an environment variable and useprocess.envin the script to check for its existence.
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.