Skip to content

Commit 7bd5bfc

Browse files
committed
feat: make SARIF upload opt-in to avoid paid feature requirement
Add upload-sarif input (default: false) to control GitHub Security tab integration. This avoids confusing error messages for private repos that don't have Code Security enabled ($30/mo per committer). Also updated CodeQL action to v4 (v3 deprecated Dec 2026). Usage for repos with Code Security enabled: with: upload-sarif: true
1 parent 7e04408 commit 7bd5bfc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/security.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ on:
6060
required: false
6161
type: boolean
6262
default: false
63+
upload-sarif:
64+
description: 'Upload SARIF to GitHub Security tab (requires Code Security enabled, paid for private repos)'
65+
required: false
66+
type: boolean
67+
default: false
6368
secrets:
6469
SEMGREP_APP_TOKEN:
6570
description: 'Optional Semgrep App token for enhanced rules'
@@ -271,11 +276,10 @@ jobs:
271276
retention-days: 30
272277

273278
- name: Upload to GitHub Security
274-
uses: github/codeql-action/upload-sarif@v3
275-
if: always()
279+
uses: github/codeql-action/upload-sarif@v4
280+
if: inputs.upload-sarif
276281
with:
277282
sarif_file: reports/semgrep.sarif
278-
continue-on-error: true
279283

280284
- name: Semgrep Summary
281285
if: always()

0 commit comments

Comments
 (0)