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.
More on SAST, SCA and secrets scanning in CI
gitleaks fails the PR on `tests/fixtures/fake_rsa.pem` and `testdata/aws_creds.json`, which only contain dummy valuesBeginnergitleaks passes locally but the CI job reports 40 old leaks nobody touched in this PRIntermediate`fatal: ambiguous argument 'origin/main..HEAD': unknown revision` in the secrets-scan stepBeginnerSemgrep flags `subprocess.run(cmd, shell=True)` in a script where `cmd` is a hard-coded constantBeginnerSemgrep in CI reports findings in `node_modules/`, `vendor/` and minified `dist/*.js`BeginnerSemgrep job takes 35 minutes and gets killed with `exit code 137`Intermediate