Interview Prep/DevSecOps/SAST, SCA and secrets scanning in CI

GitHub code scanning shows the same CodeQL alert twice, once per workflow

IntermediateTroubleshootingSAST, SCA and secrets scanning in CI
Answer

Likely causes → Two workflows upload SARIF for the same tool without distinct categories, or a renamed workflow left old analyses alive.

Diagnose →

gh api repos/:owner/:repo/code-scanning/analyses --jq '.[] | {tool: .tool.name, category, ref}' | head

Fix → Give each upload a unique category:

- uses: github/codeql-action/analyze@v3
  with:
    category: "/language:javascript"

Delete stale analyses with gh api -X DELETE .../analyses/<id>.

Prevent → One code-scanning workflow per tool, maintained centrally.

All DevSecOps questions Roadmap: Security in the pipeline

More on SAST, SCA and secrets scanning in CI