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>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-27 18:22:07 +00:00
parent a9fc5c4773
commit 7ebedc2d56

View File

@@ -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