Skip to content

Commit 0c4c3e0

Browse files
committed
chore: migrate security checks to run on a cron
They were taking a long time and seemed to be reducing concurrency for our other CI actions.
1 parent 7a8ccda commit 0c4c3e0

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

.github/workflows/security.yaml

+26-8
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ permissions:
66
security-events: write
77

88
on:
9-
push:
10-
branches: ["main"]
11-
12-
pull_request:
13-
branches: ["main"]
14-
159
workflow_dispatch:
1610

1711
schedule:
18-
# Run every week at 10:24 on Thursday.
19-
- cron: "24 10 * * 4"
12+
# Run every 6 hours Monday-Friday!
13+
- cron: "0 0,6,12,18 * * 1-5"
2014

2115
# Cancel in-progress runs for pull requests when developers push
2216
# additional changes
@@ -59,6 +53,18 @@ jobs:
5953
- name: Perform CodeQL Analysis
6054
uses: github/codeql-action/analyze@v2
6155

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+
67+
6268
trivy:
6369
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-8-cores' || 'ubuntu-latest' }}
6470
steps:
@@ -135,3 +141,15 @@ jobs:
135141
name: trivy
136142
path: trivy-results.sarif
137143
retention-days: 7
144+
145+
- name: Send Slack notification on failure
146+
if: ${{ failure() }}
147+
run: |
148+
msg="❌ CodeQL Failed\n\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
149+
curl \
150+
-qfsSL \
151+
-X POST \
152+
-H "Content-Type: application/json" \
153+
--data "{\"content\": \"$msg\"}" \
154+
"${{ secrets.SLACK_SECURITY_FAILURE_WEBHOOK_URL }}"
155+

0 commit comments

Comments
 (0)