ci: add Grok Bot release notification workflow - #995
Open
johnleider wants to merge 1 commit into
Open
johnleider wants to merge 1 commit into
johnleider wants to merge 1 commit into
Conversation
Adds a GitHub Actions workflow that POSTs release metadata to the Grok Bot webhook when a GitHub release is published. Uses repo secrets for webhook URL and authorization key. Co-authored-by: John Leider <johnleider@users.noreply.github.com>
Comment on lines
+11
to
+39
| runs-on: ubuntu-latest | ||
| if: ${{ !github.event.release.draft }} | ||
| steps: | ||
| - name: POST to Grok Bot webhook | ||
| env: | ||
| WEBHOOK_URL: ${{ secrets.GROK_BOT_RELEASE_WEBHOOK_URL }} | ||
| WEBHOOK_KEY: ${{ secrets.GROK_BOT_RELEASE_WEBHOOK_KEY }} | ||
| EVENT_PATH: ${{ github.event_path }} | ||
| run: | | ||
| set -euo pipefail | ||
| if [ -z "${WEBHOOK_URL:-}" ] || [ -z "${WEBHOOK_KEY:-}" ]; then | ||
| echo "Missing GROK_BOT_RELEASE_WEBHOOK_URL or GROK_BOT_RELEASE_WEBHOOK_KEY" | ||
| exit 1 | ||
| fi | ||
| payload=$(jq -c '{ | ||
| source: "github-actions", | ||
| event: "release.published", | ||
| repository: .repository.full_name, | ||
| tag: .release.tag_name, | ||
| name: (.release.name // .release.tag_name), | ||
| html_url: .release.html_url, | ||
| prerelease: .release.prerelease, | ||
| draft: .release.draft, | ||
| body: (.release.body // "") | ||
| }' "$EVENT_PATH") | ||
| curl -fsS -X POST "$WEBHOOK_URL" \ | ||
| -H "Authorization: Bearer $WEBHOOK_KEY" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "$payload" |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a GitHub Actions workflow that notifies Grok Bot when a release is published.
What this does
When a GitHub release is published, this workflow POSTs release metadata (tag, name, URL, prerelease status, body) to the Grok Bot webhook for the "Release → social draft" feature.
Implementation
release: publishedeventsAuthorization: Bearerheader (not possible with native GitHub webhooks)Secrets required
GROK_BOT_RELEASE_WEBHOOK_URL— already configuredGROK_BOT_RELEASE_WEBHOOK_KEY— already configured