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 auto-close script to use state_reason: 'duplicate' instead of 'not_planned' - Simplify workflow detection logic to only check for duplicate state_reason - Remove fallback logic for backward compatibility - use modern GitHub API 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
| @@ -115,14 +115,10 @@ | ||
| 115 | 115 | CLOSED_AUTOMATICALLY="true" |
| 116 | 116 | fi |
| 117 | 117 | |
| 118 | - # Check if closed as duplicate by looking for duplicate label or state_reason | |
| 118 | + # Check if closed as duplicate by state_reason | |
| 119 | 119 | CLOSED_AS_DUPLICATE="false" |
| 120 | - if [ "$STATE_REASON" = "not_planned" ]; then | |
| 121 | - # Check if issue has duplicate label | |
| 122 | - LABELS=$(echo "$ISSUE_DATA" | jq -r '.labels[] | select(.name | test("duplicate"; "i")) | .name') | |
| 123 | - if [ -n "$LABELS" ]; then | |
| 124 | - CLOSED_AS_DUPLICATE="true" | |
| 125 | - fi | |
| 120 | + if [ "$STATE_REASON" = "duplicate" ]; then | |
| 121 | + CLOSED_AS_DUPLICATE="true" | |
| 126 | 122 | fi |
| 127 | 123 | |
| 128 | 124 | # Prepare the event payload |
| @@ -65,7 +65,7 @@ | ||
| 65 | 65 | 'PATCH', |
| 66 | 66 | { |
| 67 | 67 | state: 'closed', |
| 68 | - state_reason: 'not_planned', | |
| 68 | + state_reason: 'duplicate', | |
| 69 | 69 | labels: ['duplicate'] |
| 70 | 70 | } |
| 71 | 71 | ); |