File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments