Skip to content

Fix security-scan workflow: update CodeQL Action to v4, guard SARIF upload#493

Open
Copilot wants to merge 3 commits intomainfrom
copilot/update-codeql-action-to-v4
Open

Fix security-scan workflow: update CodeQL Action to v4, guard SARIF upload#493
Copilot wants to merge 3 commits intomainfrom
copilot/update-codeql-action-to-v4

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

The security-scan/security job fails when Trivy doesn't produce a SARIF file (e.g., on scan failure) because the upload step runs unconditionally via always(). Additionally, CodeQL Action v3 is deprecated.

  • Update github/codeql-action/upload-sarif from @v3@v4
  • Add id: trivy to the Trivy step and gate the upload on steps.trivy.outcome == 'success' (outcome reflects the real result before continue-on-error is applied, unlike conclusion)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…upload condition

Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copilot AI changed the title [WIP] Update CodeQL Action to version 4 in security workflow Fix security-scan workflow: update CodeQL Action to v4, guard SARIF upload Mar 3, 2026
@IEvangelist IEvangelist marked this pull request as ready for review March 3, 2026 19:58
Copilot AI review requested due to automatic review settings March 3, 2026 19:58
@IEvangelist IEvangelist enabled auto-merge (squash) March 3, 2026 19:58
Copy link
Contributor

Copilot AI 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 fixes the security-scan/security GitHub Actions workflow so it doesn’t fail when Trivy doesn’t generate a SARIF file, and it updates the deprecated CodeQL SARIF upload action to the current major version.

Changes:

  • Add an id to the Trivy step so later steps can reliably reference its result.
  • Gate SARIF upload on the Trivy step’s outcome to avoid attempting uploads when Trivy failed to produce output.
  • Update github/codeql-action/upload-sarif from @v3 to @v4.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

3 participants