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

Use proper 'duplicate' state_reason for issue closuresBrowse files
- 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>
Boris Cherny authored on Aug 11, 2025 parent 04cace9 · commit 4a04589002a1
2 changed files+4 -8compared with 04cace9
M.github/workflows/log-issue-events.yml
Mscripts/auto-close-duplicates.ts
@@ -115,14 +115,10 @@
115115 CLOSED_AUTOMATICALLY="true"
116116 fi
117117
118- # Check if closed as duplicate by looking for duplicate label or state_reason
118+ # Check if closed as duplicate by state_reason
119119 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"
126122 fi
127123
128124 # Prepare the event payload
@@ -65,7 +65,7 @@
6565 'PATCH',
6666 {
6767 state: 'closed',
68- state_reason: 'not_planned',
68+ state_reason: 'duplicate',
6969 labels: ['duplicate']
7070 }
7171 );