mirror of
https://github.com/anthropics/claude-code.git
synced 2026-05-21 11:02:41 +00:00
Merge pull request #7192 from anthropics/inigo/update-issue-notify-repository-dispatch
feat: update issue-notify to use repository_dispatch
This commit is contained in:
19
.github/workflows/issue-notify.yml
vendored
19
.github/workflows/issue-notify.yml
vendored
@@ -18,24 +18,25 @@ jobs:
|
|||||||
ISSUE_URL: ${{ github.event.issue.html_url }}
|
ISSUE_URL: ${{ github.event.issue.html_url }}
|
||||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||||
ISSUE_TITLE: ${{ github.event.issue.title }}
|
ISSUE_TITLE: ${{ github.event.issue.title }}
|
||||||
INTERNAL_WORKFLOW: ${{ secrets.ISSUE_NOTIFY_WORKFLOW_NAME }}
|
|
||||||
TARGET_REPO: ${{ secrets.ISSUE_NOTIFY_TARGET_REPO }}
|
TARGET_REPO: ${{ secrets.ISSUE_NOTIFY_TARGET_REPO }}
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ secrets.ISSUE_NOTIFY_TOKEN || github.token }}
|
||||||
run: |
|
run: |
|
||||||
# Check if internal processing is configured
|
# Check if internal processing is configured
|
||||||
if [ -z "$INTERNAL_WORKFLOW" ] || [ -z "$TARGET_REPO" ]; then
|
if [ -z "$TARGET_REPO" ]; then
|
||||||
echo "Internal processing not configured"
|
echo "Internal processing not configured"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Processing issue #${ISSUE_NUMBER}"
|
echo "Processing issue #${ISSUE_NUMBER}"
|
||||||
|
|
||||||
# Trigger internal workflow if configured
|
# Trigger internal workflow via repository_dispatch
|
||||||
gh workflow run "$INTERNAL_WORKFLOW" \
|
gh api repos/${TARGET_REPO}/dispatches \
|
||||||
--repo "$TARGET_REPO" \
|
--method POST \
|
||||||
--field issue_url="$ISSUE_URL" 2>/dev/null || {
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
echo "Issue notification sent"
|
-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
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "✅ Issue processed"
|
echo "✅ Issue processed and dispatched to ${TARGET_REPO}"
|
||||||
Reference in New Issue
Block a user