From df984cf77008cec8767c0bf3eeaf183d805bcdec Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 19 Oct 2026 07:29:14 +0000 Subject: [PATCH] ci: forward issue events to Grok Bot webhook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 陈大猫 --- .github/workflows/grokbot-issue-relay.yml | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/grokbot-issue-relay.yml diff --git a/.github/workflows/grokbot-issue-relay.yml b/.github/workflows/grokbot-issue-relay.yml new file mode 100644 index 000000000..d3a76944c --- /dev/null +++ b/.github/workflows/grokbot-issue-relay.yml @@ -0,0 +1,38 @@ +name: Forward issue events to Grok Bot + +on: + issues: + types: [opened, reopened, edited] + issue_comment: + types: [created] + +permissions: {} + +jobs: + forward: + # PR comments are handled elsewhere; only forward real issues. + if: github.event_name == 'issues' || github.event.issue.pull_request == null + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - name: Forward minimal event to Grok Bot webhook + env: + WEBHOOK_URL: ${{ secrets.GROKBOT_WEBHOOK_URL }} + WEBHOOK_KEY: ${{ secrets.GROKBOT_WEBHOOK_KEY }} + run: | + if [ -z "$WEBHOOK_URL" ] || [ -z "$WEBHOOK_KEY" ]; then + echo "Grok Bot webhook secrets not set; skipping." + exit 0 + fi + jq --arg event "$GITHUB_EVENT_NAME" '{ + event: $event, + action: .action, + repository: .repository.full_name, + sender: .sender.login, + issue: {number: .issue.number, title: .issue.title, author: .issue.user.login, url: .issue.html_url}, + comment: (if .comment then {id: .comment.id, author: .comment.user.login, url: .comment.html_url} else null end) + }' "$GITHUB_EVENT_PATH" \ + | curl -fsS --max-time 20 -X POST \ + -H "Authorization: Bearer $WEBHOOK_KEY" \ + -H "Content-Type: application/json" \ + --data @- "$WEBHOOK_URL"