fix(ci): don't let a transient GitHub API error fail the commitlint gate - #565
Merged
Merged
Conversation
gh api's stdout on a 5xx error is its JSON error body, but the command still exits non-zero; the existing `|| true` swallowed the exit code while EXISTING_ID still captured that JSON text as if it were a real comment id. The subsequent DELETE/PATCH call then crashed on the garbage URL, failing this *required* gate for a reason unrelated to title conformance (release PR #564 hit this: title conformed, the stale-comment-cleanup lookup 503'd, and the whole job died). Validate EXISTING_ID is purely numeric before trusting it; anything else (including a JSON error blob) is treated as "no existing comment" so the conformance result stands on its own.
githubrobbi
enabled auto-merge
July 20, 2026 01:33
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 20, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 20, 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.
Summary
The commitlint gate's stale-advisory-comment cleanup looked up an
existing comment id via `gh api`. On a transient 5xx, `gh api` prints
its JSON error body to stdout while still exiting non-zero; the
existing `|| true` swallowed the exit code but not that body, so
`EXISTING_ID` could become garbage text instead of a real id. The
subsequent DELETE/PATCH then crashed on the malformed URL
(`net/url: invalid control character in URL`), failing this
required gate for a reason unrelated to title conformance.
Hit for real on release PR #564: the title conformed
(`"PR title matches Conventional Commits"` fired), but the lookup
503'd and the whole job died anyway.
Fix
Validate `EXISTING_ID` is purely numeric before trusting it; anything
else (including a JSON error blob) is treated as "no existing comment".
Test plan