ci: dry-run the Hacktoberfest prep tracker on push/PR (#15227)

* ci: dry-run hacktoberfest prep on push/PR, add path filters

* ci: use double quotes in path filters (prettier)

* fix: resolve tracker rows via /issues so issue rows don't 404

The tracker's 'Open issues' section lists issue numbers; querying them
against /pulls/{n} returns 404 and crashed the whole refresh. Query the
unified /issues/{n} endpoint instead, which resolves for both PRs and
issues; a row is 'merged' only when it's a PR with merged_at set.
This commit is contained in:
priya-sundaram-dev
2026-09-08 12:53:28 +02:00
committed by GitHub
parent fb906d8504
commit 22899ed01e
2 changed files with 35 additions and 3 deletions
+14 -3
View File
@@ -113,11 +113,22 @@ async def _search_count(
async def pr_state(
client: httpx2.AsyncClient, sem: asyncio.Semaphore, number: int
) -> str | None:
"""Return ``"merged"`` / ``"closed"`` for a resolved PR, else ``None``."""
body, _ = await _request(client, sem, f"{API}/repos/{REPO}/pulls/{number}")
"""Return ``"merged"`` / ``"closed"`` for a resolved row, else ``None``.
Uses the unified ``/issues/{number}`` endpoint, which resolves for both
pull requests *and* issues. The tracker's "Open issues" section lists
issue numbers, and ``/pulls/{issue}`` 404s on those, so querying
``/issues`` keeps a single issue row from crashing the whole run. A row is
"merged" only when it is a PR whose ``pull_request.merged_at`` is set; any
other closed row is "closed".
"""
body, _ = await _request(client, sem, f"{API}/repos/{REPO}/issues/{number}")
if body.get("state") == "open": # type: ignore[union-attr]
return None
return "merged" if body.get("merged_at") else "closed" # type: ignore[union-attr]
pr = body.get("pull_request") # type: ignore[union-attr]
if pr and pr.get("merged_at"):
return "merged"
return "closed"
async def top_awaiting_directories(