From f387fdb166ac9834b470a21c82e4686560046587 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Sun, 18 May 2025 18:45:17 +0100 Subject: [PATCH] chore: Add workflow to post security advisories to Slack (#21383) --- .github/workflows/advisories-to-slack.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/advisories-to-slack.yml diff --git a/.github/workflows/advisories-to-slack.yml b/.github/workflows/advisories-to-slack.yml new file mode 100644 index 0000000000..200dd01bd5 --- /dev/null +++ b/.github/workflows/advisories-to-slack.yml @@ -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