@@ -6,17 +6,11 @@ permissions:
6
6
security-events :write
7
7
8
8
on :
9
- push :
10
- branches :["main"]
11
-
12
- pull_request :
13
- branches :["main"]
14
-
15
9
workflow_dispatch :
16
10
17
11
schedule :
18
- # Run everyweek at 10:24 on Thursday.
19
- -cron :" 24 10 * *4 "
12
+ # Run every6 hours Monday-Friday!
13
+ -cron :" 0 0,6,12,18 * *1-5 "
20
14
21
15
# Cancel in-progress runs for pull requests when developers push
22
16
# additional changes
59
53
-name :Perform CodeQL Analysis
60
54
uses :github/codeql-action/analyze@v2
61
55
56
+ -name :Send Slack notification on failure
57
+ if :${{ failure() }}
58
+ run :|
59
+ msg="❌ CodeQL Failed\n\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
60
+ curl \
61
+ -qfsSL \
62
+ -X POST \
63
+ -H "Content-Type: application/json" \
64
+ --data "{\"content\": \"$msg\"}" \
65
+ "${{ secrets.SLACK_SECURITY_FAILURE_WEBHOOK_URL }}"
66
+
62
67
trivy :
63
68
runs-on :${{ github.repository_owner == 'coder' && 'ubuntu-latest-8-cores' || 'ubuntu-latest' }}
64
69
steps :
@@ -135,3 +140,14 @@ jobs:
135
140
name :trivy
136
141
path :trivy-results.sarif
137
142
retention-days :7
143
+
144
+ -name :Send Slack notification on failure
145
+ if :${{ failure() }}
146
+ run :|
147
+ msg="❌ CodeQL Failed\n\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
148
+ curl \
149
+ -qfsSL \
150
+ -X POST \
151
+ -H "Content-Type: application/json" \
152
+ --data "{\"content\": \"$msg\"}" \
153
+ "${{ secrets.SLACK_SECURITY_FAILURE_WEBHOOK_URL }}"