From 7ebedc2d566dc59a829b182bc31fda98440da21e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 27 Dec 2025 18:22:07 +0000 Subject: [PATCH] Fix API error detection in fetch_all_open_issues - Corrected error check to detect GitHub API error objects - API errors return {message: "..."} not array with message - All tests still passing Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- scripts/triage-duplicate-issues.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/triage-duplicate-issues.sh b/scripts/triage-duplicate-issues.sh index b7422c407..d511d261f 100755 --- a/scripts/triage-duplicate-issues.sh +++ b/scripts/triage-duplicate-issues.sh @@ -86,10 +86,10 @@ fetch_all_open_issues() { -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/$OWNER/$REPO/issues?state=open&per_page=$per_page&page=$page&sort=created&direction=desc") - # Check for API errors - if echo "$response" | jq -e '.[0].message' > /dev/null 2>&1; then + # Check for API errors (errors return object with .message, not array) + if echo "$response" | jq -e 'select(.message != null) | .message' > /dev/null 2>&1; then local error_msg - error_msg=$(echo "$response" | jq -r '.[0].message') + error_msg=$(echo "$response" | jq -r '.message') echo "❌ GitHub API error: $error_msg" >&2 return 1 fi