From 156d9e9e3faa90e98861a73c504c3acbaa83670d Mon Sep 17 00:00:00 2001 From: inigo Date: Thu, 4 Sep 2025 22:24:51 -0700 Subject: [PATCH] feat: update issue-notify to use repository_dispatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch from workflow_dispatch to repository_dispatch for cross-repo triggering of issue-detective workflow in claude-cli-internal. Changes: - Use gh api with repository_dispatch endpoint - Send issue_url in client_payload - Support ISSUE_NOTIFY_TOKEN secret for better permissions - Remove dependency on ISSUE_NOTIFY_WORKFLOW_NAME secret This enables automatic issue detective analysis when issues are opened in claude-code repository. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/issue-notify.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/issue-notify.yml b/.github/workflows/issue-notify.yml index d31e8cbc2..d07d396d4 100644 --- a/.github/workflows/issue-notify.yml +++ b/.github/workflows/issue-notify.yml @@ -18,24 +18,25 @@ jobs: ISSUE_URL: ${{ github.event.issue.html_url }} ISSUE_NUMBER: ${{ github.event.issue.number }} ISSUE_TITLE: ${{ github.event.issue.title }} - INTERNAL_WORKFLOW: ${{ secrets.ISSUE_NOTIFY_WORKFLOW_NAME }} TARGET_REPO: ${{ secrets.ISSUE_NOTIFY_TARGET_REPO }} - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.ISSUE_NOTIFY_TOKEN || github.token }} run: | # Check if internal processing is configured - if [ -z "$INTERNAL_WORKFLOW" ] || [ -z "$TARGET_REPO" ]; then + if [ -z "$TARGET_REPO" ]; then echo "Internal processing not configured" exit 0 fi echo "Processing issue #${ISSUE_NUMBER}" - # Trigger internal workflow if configured - gh workflow run "$INTERNAL_WORKFLOW" \ - --repo "$TARGET_REPO" \ - --field issue_url="$ISSUE_URL" 2>/dev/null || { - echo "Issue notification sent" + # Trigger internal workflow via repository_dispatch + gh api repos/${TARGET_REPO}/dispatches \ + --method POST \ + -H "Accept: application/vnd.github.v3+json" \ + -f event_type="issue-opened" \ + -f "client_payload[issue_url]=${ISSUE_URL}" 2>/dev/null || { + echo "Issue notification sent (dispatch may have failed due to permissions)" exit 0 } - echo "✅ Issue processed" \ No newline at end of file + echo "✅ Issue processed and dispatched to ${TARGET_REPO}" \ No newline at end of file