chore: Add workflow to post security advisories to Slack (#21383)

This commit is contained in:
Alex van Andel
2025-05-18 17:45:17 +00:00
committed by GitHub
parent ec8f9d5f7a
commit f387fdb166
+23
View File
@@ -0,0 +1,23 @@
name: Notify New Security Advisories
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Fetch advisories and send to Slack
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_SECURITY_ADVISORIES }}
run: |
curl -s -H "Authorization: token $GH_TOKEN" \
https://api.github.com/repos/calcom/cal.com/security-advisories \
| jq -r '.[] | select(.state=="published") | "\(.summary)\n\(.url)"' \
| while read -r msg; do
[ -n "$msg" ] && curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"$msg\"}" "$SLACK_WEBHOOK"
done