chore: Add workflow to post security advisories to Slack (#21383)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user