Skip to content

Notify Grok Bot when a pull request opens or is marked ready - #62

Closed
mark-groves wants to merge 1 commit into
quattrofrom
cursor/grokbot-pr-webhook-899c
Closed

mark-groves wants to merge 1 commit into
quattrofrom
cursor/grokbot-pr-webhook-899c

Conversation

@mark-groves

@mark-groves mark-groves commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

What this does

Adds a fork-only workflow, .github/workflows/grokbot-pr-webhook.yml, that POSTs to Mark's Grok Bot routine webhook when a pull request is opened or marked ready for review. A cursor[bot] draft therefore wakes the bot twice: opened at creation ("draft": true) and ready_for_review when it is flipped to ready about 20 seconds later.

The trigger is pull_request with types opened and ready_for_review. One ubuntu-latest job, timeout-minutes: 2, permissions: {}, no checkout. Event fields go through env: and the body is built with jq -n --arg/--argjson, so a pull request title stays data. The request sends Authorization: Bearer $GROKBOT_PR_WEBHOOK_KEY and Content-Type: application/json with curl --fail-with-body --retry 3 --max-time 20. A non-2xx response fails the job (curl exit 22) so a broken webhook is visible.

{"repo": "owner/name", "pr": 123, "action": "opened", "url": "https://github.com/owner/name/pull/123", "title": "title", "author": "login", "draft": false}

action is opened or ready_for_review. pr is a number and draft is a boolean.

If GROKBOT_PR_WEBHOOK_URL or GROKBOT_PR_WEBHOOK_KEY is empty (a pull request from a fork of this fork, or before these secrets exist), the job logs a notice and exits 0.

Secrets to add

On mark-groves/omarchy, open Settings > Secrets and variables > Actions and add these repository secrets:

  • GROKBOT_PR_WEBHOOK_URL
  • GROKBOT_PR_WEBHOOK_KEY

The URL and key are not in the repo. This pull request's opened run already finished and took the skip path, because the secrets are still empty. Adding them does not replay that run. The next opened or ready_for_review event will POST.

Fork-only — upstream sync must keep this file

.github/workflows/grokbot-pr-webhook.yml belongs only to the mark-groves/omarchy fork. It is not in omacom/omarchy. Future Omarchy Sync runs must keep this file when cherry-picking upstream quattro.

Actions is enabled on this fork

GET /repos/mark-groves/omarchy/actions/workflows returns HTTP 200, and the workflow is registered as state: active. Run 37692704969 completed success in 7s on this pull request (pull_request / opened, head 51dbf25c). gh run list shows that run. GET /repos/mark-groves/omarchy/actions/permissions returned 403 because this token is not an admin; the successful run is the enabled signal.

The live log shows both secrets empty, the event fields filled in, and the skip notice:

WEBHOOK_URL:
WEBHOOK_KEY:
REPO: mark-groves/omarchy
PR: 62
ACTION: opened
URL: https://github.com/mark-groves/omarchy/pull/62
TITLE: Notify Grok Bot when a pull request opens or is marked ready
AUTHOR: mark-groves
DRAFT: false
##[notice]GROKBOT_PR_WEBHOOK_URL or GROKBOT_PR_WEBHOOK_KEY is unset; skipping webhook

GITHUB_TOKEN on that job is Metadata: read, which is what permissions: {} allows.

Proof

actionlint v1.7.12 with shellcheck 0.9.0: exit 0, no findings.

The job script was extracted from the workflow and run with bash --noprofile --norc -eo pipefail against a local HTTP listener. The sample event is the GitHub pull payload for draft PR #57 (cursor[bot]). The ready_for_review case uses that same payload with action set to ready_for_review and draft set to false, which is what GitHub sends when a draft is marked ready. A third case puts shell metacharacters in the title. The listener recorded:

Authorization: Bearer test-key-not-a-real-secret
Content-Type: application/json
{
  "repo": "mark-groves/omarchy",
  "pr": 57,
  "action": "opened",
  "url": "https://github.com/mark-groves/omarchy/pull/57",
  "title": "Merge upstream quattro (multi-account Claude/Codex/Grok, omarchy-app)",
  "author": "cursor[bot]",
  "draft": true
}
Authorization: Bearer test-key-not-a-real-secret
Content-Type: application/json
{
  "repo": "mark-groves/omarchy",
  "pr": 57,
  "action": "ready_for_review",
  "url": "https://github.com/mark-groves/omarchy/pull/57",
  "title": "Merge upstream quattro (multi-account Claude/Codex/Grok, omarchy-app)",
  "author": "cursor[bot]",
  "draft": false
}
Authorization: Bearer test-key-not-a-real-secret
Content-Type: application/json
{
  "repo": "mark-groves/omarchy",
  "pr": 57,
  "action": "opened",
  "url": "https://github.com/mark-groves/omarchy/pull/57",
  "title": "\"; $(touch /tmp/grokbot-proof/pwned) `id` && echo injected",
  "author": "cursor[bot]",
  "draft": true
}

pr arrived as a JSON number and draft as a JSON boolean. The injection title was stored as a string; nothing executed it.

Empty GROKBOT_PR_WEBHOOK_URL, empty GROKBOT_PR_WEBHOOK_KEY, and both empty each printed the notice and exited 0, and the listener received no extra request.

A listener that returns HTTP 500 made the script exit 22 after 4 attempts (--retry 3 retried the POST at 1s, 2s, and 4s).

Open in Web Open in Cursor 

POST opened and ready_for_review events when the webhook secrets are set.

Co-authored-by: Mark Groves <mark-groves@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7d5e3b45-f1a6-46e9-b4aa-b7aba4b1f327
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Owner Author

Dropped: Mark declined webhook; daily sweeps cover draft alerts.

@mark-groves mark-groves closed this Oct 7, 2026
@cursor
cursor Bot deleted the cursor/grokbot-pr-webhook-899c branch October 7, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants