Skip to content

Commit 1c5edad

Browse files
authored
chore/change-api (#2143)
1 parent c064f66 commit 1c5edad

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/repo-stats.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,28 @@ jobs:
4747
REPO="${GH_REPO#*/}"
4848
API="https://api.github.com/repos/${OWNER}/${REPO}"
4949
50+
# Debug: inspect API response (expand "Debug: API request and response" in the log to fix issues without merge cycles)
51+
echo "::group::Debug: API request and response"
52+
echo "Repo: $GH_REPO | START: $START | END: $END"
53+
echo "API base: $API"
54+
PULLS_RESP=$(curl -sS -w "\n%{http_code}" -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" "${API}/pulls?state=closed&per_page=5")
55+
PULLS_BODY=$(echo "$PULLS_RESP" | head -n -1)
56+
PULLS_CODE=$(echo "$PULLS_RESP" | tail -n1)
57+
echo "GET /pulls?state=closed&per_page=5 → HTTP $PULLS_CODE"
58+
echo "$PULLS_BODY" > /tmp/debug_pulls.json
59+
if echo "$PULLS_BODY" | jq -e . >/dev/null 2>&1; then
60+
echo "Response is valid JSON. Array length: $(echo "$PULLS_BODY" | jq 'length')"
61+
echo "First item keys: $(echo "$PULLS_BODY" | jq -r '.[0] | keys | join(", ")')"
62+
echo "First item merged_at: $(echo "$PULLS_BODY" | jq -r '.[0].merged_at // "null"')"
63+
echo "First 800 chars of response:"
64+
echo "$PULLS_BODY" | head -c 800
65+
echo ""
66+
else
67+
echo "Response (first 500 chars):"
68+
echo "$PULLS_BODY" | head -c 500
69+
fi
70+
echo "::endgroup::"
71+
5072
echo "## Repository activity: $START → $END" > report.md
5173
echo "" >> report.md
5274

0 commit comments

Comments
 (0)