fix(ci): repair monthly PR digest — gh pr list over gh search prs#25
Merged
Conversation
The monthly digest posted "No PRs opened or closed in this period" for every repo. `gh search prs` runs over the issue-search API and does not expose mergedAt/additions/deletions/changedFiles/commits — it errored on those --json fields, and `2>/dev/null || echo '[]'` swallowed the failure into an empty result, so every run reported zero PRs. - Query PRs via `gh pr list --search` (GraphQL PR API) instead of `gh search prs`; drop the error-swallowing fallback so a failed query fails the job loudly instead of faking an empty month. - Fetch commit trailers per PR: the commits connection blows the GraphQL node limit in a bulk pr-list call. Match Co-authored-by case-insensitively (Cursor writes "Co-authored-by:", Claude "Co-Authored-By:") — Claude co-authors were previously dropped entirely. Verified against backendforth/next-sanity-starter for June 2026: 59 PRs, 41 merged, +22011/-11966, 25 Dependabot / 34 Human, tools Claude 27 / Cursor 25. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The monthly Slack digest posted "No PRs opened or closed in this period." for every repo (VaultLens, mammalsandcomputers, farbstudio.de, bef-website-2026, next-sanity-starter) for June 2026 — despite dozens of real PRs.
Root cause:
gh search prsruns over the issue-search API and does not exposemergedAt,additions,deletions,changedFiles,commits. It errors withUnknown JSON field: "mergedAt", and2>/dev/null || echo '[]'swallowed that failure into[]→pr_count=0→skip=true→ the empty digest. Because the error is static (not repo-dependent), every repo reported zero.Fix
gh pr list --search(GraphQL PR API), which supports the rich fields. Drop the2>/dev/null || echo '[]'fallback so a genuinely failed query fails the job loudly instead of faking an empty month.commitsconnection blows the GraphQL node limit in a bulk pr-list call → fetch commits per PR (cheap for a monthly job, failure-tolerant);Co-authored-bycase-insensitively — Cursor writesCo-authored-by:, Claude writesCo-Authored-By:, so every Claude co-author was silently dropped before (on top of the.messagefield not existing — it's.messageBody).One reusable workflow → fixes all caller repos at once.
Verification
Ran the full corrected Collect step against
backendforth/next-sanity-starterfor June 2026:digest-context.jsonis valid; workflow YAML validates.After merge
Re-post June's digest immediately via each caller's
workflow_dispatch(today is July 1 → "last month" still resolves to June).🤖 Generated with Claude Code