Skip to content

Commit 42322e9

Browse files
author
jonasflorencio
committed
Fix Semgrep Workflow
1 parent b7a23c3 commit 42322e9

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/semgrep.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,30 @@ jobs:
1212

1313
- name: Install Semgrep and jq
1414
run: |
15-
pip install semgrep jq
15+
pip install --upgrade pip
16+
pip install --upgrade semgrep jq
17+
1618
- name: Run Semgrep Scan and Save JSON
1719
run: |
18-
semgrep --config p/go --json > semgrep-report.json
20+
semgrep \
21+
--config "https://semgrep.dev/p/golang" \
22+
--json > semgrep-report.json
23+
1924
- name: Count Critical and Error findings
2025
id: findings
2126
run: |
2227
count=$(jq '[.results[] | select(.extra.severity == "CRITICAL" or .extra.severity == "ERROR")] | length' semgrep-report.json)
2328
echo "count=$count" >> $GITHUB_OUTPUT
29+
2430
- name: Send findings to webhook
31+
if: always()
2532
env:
2633
ROCKETCHAT_WEBHOOK_URL: ${{ secrets.ROCKETCHAT_WEBHOOK_URL }}
2734
run: |
2835
curl -X POST "$ROCKETCHAT_WEBHOOK_URL" \
2936
-H "Content-Type: application/json" \
3037
--data "{\"alias\":\"Security Notifications\",\"text\":\"**Semgrep Report - ($GITHUB_REPOSITORY)**\n\n**Finding count (Critical and Error):** ${{ steps.findings.outputs.count }}\"}"
38+
3139
- name: Print findings in logs
3240
run: |
3341
echo "=== ALL SEMGREP FINDINGS ==="

0 commit comments

Comments
 (0)