@@ -23,29 +23,28 @@ jobs:
2323 steps :
2424 - uses : actions/checkout@v4
2525 - name : Run Semgrep (diff only)
26- run : semgrep ci --config auto --sarif --output semgrep.sarif
27- env :
28- SEMGREP_APP_TOKEN : ${{ secrets.SEMGREP_APP_TOKEN }}
29- - uses : github/codeql-action/upload-sarif@v3
30- if : always()
31- with :
32- sarif_file : semgrep.sarif
26+ run : semgrep ci --config auto --error
3327
34- # Scan complet sur push main et releases (thorough)
3528 semgrep-full :
3629 name : Semgrep SAST (full)
37- if : github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'workflow_dispatch'
30+ if : github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request'
3831 runs-on : ubuntu-latest
3932 container :
4033 image : semgrep/semgrep
4134 steps :
4235 - uses : actions/checkout@v4
43- - name : Run Semgrep (full scan)
44- run : semgrep scan --config auto --sarif --output semgrep.sarif
45- # 👆 "scan" au lieu de "ci" = scan complet, pas de diff
46- env :
47- SEMGREP_APP_TOKEN : ${{ secrets.SEMGREP_APP_TOKEN }}
48- - uses : github/codeql-action/upload-sarif@v3
49- if : always()
50- with :
51- sarif_file : semgrep.sarif
36+ - name : Run Semgrep (WARNING severity)
37+ run : |
38+ semgrep scan \
39+ --config auto \
40+ --severity WARNING \
41+ --json --output semgrep-warnings.json
42+ exit 0 # Ne jamais bloquer ce job
43+
44+ - name : Run Semgrep (ERROR severity only)
45+ run : |
46+ semgrep scan \
47+ --config auto \
48+ --severity ERROR \
49+ --error \
50+ --json --output semgrep-blocking.json
0 commit comments