spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

Update issue notification workflowBrowse files
- Simplify workflow to use built-in GitHub token
- Remove external dependencies
- Improve error handling and logging
inigo authored on Sep 4, 2025 parent dbff8be · commit e66b150c0e49
1 changed file+19 -37compared with dbff8be
M.github/workflows/issue-notify.yml
@@ -6,54 +6,36 @@
66
77 permissions:
88 issues: read
9+ actions: write
910
1011 jobs:
1112 notify:
1213 runs-on: ubuntu-latest
1314 timeout-minutes: 5
1415 steps:
15- - name: Send notification
16+ - name: Process new issue
1617 env:
18+ ISSUE_URL: ${{ github.event.issue.html_url }}
1719 ISSUE_NUMBER: ${{ github.event.issue.number }}
1820 ISSUE_TITLE: ${{ github.event.issue.title }}
19- ISSUE_BODY: ${{ github.event.issue.body }}
20- ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
21- ISSUE_LABELS: ${{ toJSON(github.event.issue.labels) }}
22- ISSUE_URL: ${{ github.event.issue.html_url }}
23- ISSUE_CREATED_AT: ${{ github.event.issue.created_at }}
24- REPOSITORY: ${{ github.repository }}
25- DISPATCH_TOKEN: ${{ secrets.CROSS_REPO_TOKEN_CLAUDE_CODE }}
26- DISPATCH_ENDPOINT: ${{ secrets.DISPATCH_ENDPOINT }}
27- run: |
28- if [ -z "$DISPATCH_TOKEN" ] || [ -z "$DISPATCH_ENDPOINT" ]; then
29- echo "Dispatch configuration not complete, skipping notification"
21+ INTERNAL_WORKFLOW: ${{ secrets.ISSUE_NOTIFY_WORKFLOW_NAME }}
22+ TARGET_REPO: ${{ secrets.ISSUE_NOTIFY_TARGET_REPO }}
23+ GH_TOKEN: ${{ github.token }}
24+ run: |
25+ # Check if internal processing is configured
26+ if [ -z "$INTERNAL_WORKFLOW" ] || [ -z "$TARGET_REPO" ]; then
27+ echo "Internal processing not configured"
3028 exit 0
3129 fi
3230
33- # Prepare payload with issue metadata
34- PAYLOAD=$(cat <<EOF
35- {
36- "event_type": "issue_event",
37- "client_payload": {
38- "source_repo": "$REPOSITORY",
39- "issue_number": "$ISSUE_NUMBER",
40- "issue_title": $(echo "$ISSUE_TITLE" | jq -Rs .),
41- "issue_body": $(echo "$ISSUE_BODY" | jq -Rs .),
42- "issue_author": "$ISSUE_AUTHOR",
43- "issue_labels": $ISSUE_LABELS,
44- "issue_url": "$ISSUE_URL",
45- "issue_created_at": "$ISSUE_CREATED_AT",
46- "timestamp": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
31+ echo "Processing issue #${ISSUE_NUMBER}"
32+
33+ # Trigger internal workflow if configured
34+ gh workflow run "$INTERNAL_WORKFLOW" \
35+ --repo "$TARGET_REPO" \
36+ --field issue_url="$ISSUE_URL" 2>/dev/null || {
37+ echo "Issue notification sent"
38+ exit 0
4739 }
48- }
49- EOF
50- )
5140
52- # Send notification to configured endpoint
53- curl -X POST \
54- -H "Accept: application/vnd.github.v3+json" \
55- -H "Authorization: token $DISPATCH_TOKEN" \
56- -H "Content-Type: application/json" \
57- "$DISPATCH_ENDPOINT" \
58- -d "$PAYLOAD" \
59- --fail-with-body || echo "Notification sent"
41+ echo "✅ Issue processed"