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 workflow
| @@ -6,54 +6,36 @@ | ||
| 6 | 6 | |
| 7 | 7 | permissions: |
| 8 | 8 | issues: read |
| 9 | + actions: write | |
| 9 | 10 | |
| 10 | 11 | jobs: |
| 11 | 12 | notify: |
| 12 | 13 | runs-on: ubuntu-latest |
| 13 | 14 | timeout-minutes: 5 |
| 14 | 15 | steps: |
| 15 | - - name: Send notification | |
| 16 | + - name: Process new issue | |
| 16 | 17 | env: |
| 18 | + ISSUE_URL: ${{ github.event.issue.html_url }} | |
| 17 | 19 | ISSUE_NUMBER: ${{ github.event.issue.number }} |
| 18 | 20 | 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" | |
| 30 | 28 | exit 0 |
| 31 | 29 | fi |
| 32 | 30 | |
| 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 | |
| 47 | 39 | } |
| 48 | - } | |
| 49 | - EOF | |
| 50 | - ) | |
| 51 | 40 | |
| 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" |