Skip to content

Commit e303d18

Browse files
allanhaggettclaude
andcommitted
Split semgrep into text + SARIF steps to show findings in CI log
The --sarif --output combo suppresses text output, hiding finding details. Run text output first (blocking on --error), then generate SARIF separately for GitHub Security upload. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8600520 commit e303d18

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/semgrep.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Checkout code
2222
uses: actions/checkout@v6
2323

24-
- name: Run Semgrep OWASP Top 10 + Custom Moodle Rules
24+
- name: Run Semgrep (text output for visibility)
2525
run: |
2626
semgrep --config "p/owasp-top-ten" \
2727
--config "p/php" \
@@ -34,6 +34,21 @@ jobs:
3434
--config .semgrep.yml \
3535
--exclude-rule "generic.html-templates.security.var-in-href.var-in-href" \
3636
--error \
37+
.
38+
39+
- name: Generate SARIF report
40+
if: always()
41+
run: |
42+
semgrep --config "p/owasp-top-ten" \
43+
--config "p/php" \
44+
--config "p/security-audit" \
45+
--config "p/command-injection" \
46+
--config "p/sql-injection" \
47+
--config "p/xss" \
48+
--config "p/secrets" \
49+
--config "p/insecure-transport" \
50+
--config .semgrep.yml \
51+
--exclude-rule "generic.html-templates.security.var-in-href.var-in-href" \
3752
--sarif \
3853
--output=semgrep-results.sarif \
3954
.

0 commit comments

Comments
 (0)