Skip to content

Commit f387fdb

Browse files
authored
chore: Add workflow to post security advisories to Slack (calcom#21383)
1 parent ec8f9d5 commit f387fdb

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Notify New Security Advisories
2+
3+
on:
4+
schedule:
5+
- cron: '0 * * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
notify:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Fetch advisories and send to Slack
13+
env:
14+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_SECURITY_ADVISORIES }}
16+
run: |
17+
curl -s -H "Authorization: token $GH_TOKEN" \
18+
https://api.github.com/repos/calcom/cal.com/security-advisories \
19+
| jq -r '.[] | select(.state=="published") | "\(.summary)\n\(.url)"' \
20+
| while read -r msg; do
21+
[ -n "$msg" ] && curl -X POST -H 'Content-type: application/json' \
22+
--data "{\"text\":\"$msg\"}" "$SLACK_WEBHOOK"
23+
done

0 commit comments

Comments
 (0)