From b43e43a63e5455796eae092566c56c638cb0a06b Mon Sep 17 00:00:00 2001 From: Frederic BIDON Date: Mon, 22 Jun 2026 19:41:09 +0200 Subject: [PATCH] ci: post README announcements to discord Add the webhook-announcements workflow (mirrors go-openapi/testify): pushes to master that change README.md are scanned for new "## Announcements" entries and posted to the discord channel. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Frederic BIDON --- .github/workflows/webhook-announcements.yml | 60 +++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/webhook-announcements.yml diff --git a/.github/workflows/webhook-announcements.yml b/.github/workflows/webhook-announcements.yml new file mode 100644 index 0000000..a21bb82 --- /dev/null +++ b/.github/workflows/webhook-announcements.yml @@ -0,0 +1,60 @@ +name: Webhook Announcements + +# invoke the common webhook-announcements workflow, scanning README. +# +# Two modes: +# +# * push: diff on "## Announcements" section exercises the +# real before..after detection and post to discord channel. +# +# * workflow_dispatch: a manual live run. Optionally provide an arbitrary webhook URL and +# it POSTs for real. By default it diffs against the git empty tree, so every +# announcement currently in the fixture is posted — no need to craft a diff. +# +# NOTE: the webhook URL you type is a workflow_dispatch input and is therefore +# visible in the run's UI/logs. Use a throwaway test webhook (and/or rotate it +# afterwards), not the production go-openapi webhook. + +permissions: + contents: read + +on: + push: + branches: + - master + paths: + - 'README.md' + + workflow_dispatch: + inputs: + webhook-url: + description: | + Webhook URL to POST to (e.g. a test Discord channel webhook). + Visible in run logs — use a throwaway webhook. + type: string + default: '' + compare-base: + description: | + Git ref to diff the fixture against. The default empty-tree SHA posts + every announcement currently in the fixture. + type: string + default: "" + dry-run: + description: | + Print payloads instead of posting. + type: choice + options: + - 'false' + - 'true' + default: 'false' + +jobs: + announce: + uses: go-openapi/ci-workflows/.github/workflows/webhook-announcements.yml@af4c93f45481ea7d24ac2a9858272cc03daf424e # v0.4.0 + with: + scanned-markdown: README.md + # On push: normal before..after diff (empty + # compare-base). On dispatch: honor the provided inputs. + dry-run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry-run || 'false' }} + compare-base: ${{ github.event_name == 'workflow_dispatch' && inputs.compare-base || '' }} + secrets: inherit