Skip to content

fix(ci): normalize PR state to lowercase in auto-patch (closed-PR guardrail)#67

Merged
WiktorStarczewski merged 1 commit into
mainfrom
wiktor/auto-patch-state-case-fix
Apr 30, 2026
Merged

fix(ci): normalize PR state to lowercase in auto-patch (closed-PR guardrail)#67
WiktorStarczewski merged 1 commit into
mainfrom
wiktor/auto-patch-state-case-fix

Conversation

@WiktorStarczewski
Copy link
Copy Markdown
Collaborator

Followup to #65: gh's REST API returns pull-request state as 'open'/'closed' (lowercase), but the action and dev script were comparing against uppercase 'OPEN'. Result: every run with a Client PR: marker triggered the closed-PR guardrail and exited with 'is closed without merge', even on open PRs. Normalize via tr.

Verified against miden-client#2059 (state='open' from REST → was rejecting it; with this fix it's accepted).

gh's REST API returns pull-request state as 'open' / 'closed', GraphQL
returns 'OPEN' / 'CLOSED'. The closed-PR guardrail in the composite
action and the dev script were comparing against the uppercase form,
so the closed-without-merge branch always fired even on open PRs —
the action exited with 'is closed without merge' on every run with a
'Client PR:' marker.

Normalize the API-returned value via tr to lowercase, then compare to
'open'. Verified against miden-client#2059 (state='open' from REST).
@WiktorStarczewski WiktorStarczewski added the no changelog PR doesn't need a CHANGELOG entry (trivial / non-user-visible) label Apr 30, 2026
@WiktorStarczewski WiktorStarczewski merged commit 5c9f75a into main Apr 30, 2026
33 of 35 checks passed
@WiktorStarczewski WiktorStarczewski deleted the wiktor/auto-patch-state-case-fix branch April 30, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR doesn't need a CHANGELOG entry (trivial / non-user-visible)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant