Skip to content

Commit bdcfe9c

Browse files
Setup CodeQL Slack notifications
1 parent f291c45 commit bdcfe9c

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

.github/workflows/codeql.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: CodeQL
22

3-
on:
4-
workflow_dispatch:
5-
schedule:
6-
# Run at the end of every Monday
7-
- cron: '0 0 * * 1'
3+
on:
4+
push:
85

96
jobs:
107
analyze:
@@ -68,3 +65,15 @@ jobs:
6865
uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3
6966
with:
7067
category: '/language:${{matrix.config.language}}'
68+
output: sarif-output-${{ matrix.config.language }}.sarif
69+
- name: Filter SARIF Results
70+
run: |
71+
REPO_URL="https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/"
72+
jq --arg baseUrl "$REPO_URL" '.runs[].results[] |
73+
{
74+
ruleId: .ruleId,
75+
message: .message.text,
76+
url: "\($baseUrl)\(.locations[0].physicalLocation.artifactLocation.uri)#L\(.locations[0].physicalLocation.region.startLine)-L\(.locations[0].physicalLocation.region.endLine)"
77+
}' sarif-output-${{ matrix.config.language }}.sarif/${{ matrix.config.language }}.sarif > filtered-${{ matrix.config.language }}.json
78+
- name: Display Filtered Results
79+
run: cat filtered-${{ matrix.config.language }}.json

0 commit comments

Comments
 (0)