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
Add validation to comment-on-duplicates.sh that verifies the base issue and all potential duplicate issues actually exist in the repo before posting a comment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
| @@ -60,6 +60,20 @@ | ||
| 60 | 60 | fi |
| 61 | 61 | done |
| 62 | 62 | |
| 63 | +# Validate that base issue exists | |
| 64 | +if ! gh issue view "$BASE_ISSUE" --repo "$REPO" &>/dev/null; then | |
| 65 | + echo "Error: issue #$BASE_ISSUE does not exist in $REPO" >&2 | |
| 66 | + exit 1 | |
| 67 | +fi | |
| 68 | + | |
| 69 | +# Validate that all duplicate issues exist | |
| 70 | +for dup in "${DUPLICATES[@]}"; do | |
| 71 | + if ! gh issue view "$dup" --repo "$REPO" &>/dev/null; then | |
| 72 | + echo "Error: issue #$dup does not exist in $REPO" >&2 | |
| 73 | + exit 1 | |
| 74 | + fi | |
| 75 | +done | |
| 76 | + | |
| 63 | 77 | # Build comment body |
| 64 | 78 | COUNT=${#DUPLICATES[@]} |
| 65 | 79 | if [[ $COUNT -eq 1 ]]; then |