fix: reopen a closed matching PR instead of 422 #9

Merged
stephen merged 1 commit from fix/reopen-closed-pr into main 2026-06-30 21:02:34 +00:00
Owner

When a head/base match existed but was CLOSED, the lookup queried only state=open and fell through to POST /pulls, hard-422ing. Now the lookup includes closed PRs; on a closed match it reopens (PATCH state=open) and updates title/body instead of creating. Test covers the closed-match path.

Backlog #15.

When a head/base match existed but was CLOSED, the lookup queried only state=open and fell through to POST /pulls, hard-422ing. Now the lookup includes closed PRs; on a closed match it reopens (PATCH state=open) and updates title/body instead of creating. Test covers the closed-match path. Backlog #15.
fix: reopen a closed PR for the same head/base instead of 422
All checks were successful
test / unit (pull_request) Successful in 11s
79d70459e8
The existing-PR lookup only queried state=open, so when a matching
head/base PR was closed it was missed and the action fell through to
POST /pulls, which Forgejo rejects with a 422 for the duplicate
head/base.

Include closed PRs in the lookup (state=all). On a closed match, reopen
it (PATCH state=open) and refresh title/body instead of creating a new
PR. An open match still updates, and a no-match still creates, as before.
Adds a reopened value to pull-request-operation and covers the closed
path in the offline suite.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rasterstate/create-pull-request-action!9
No description provided.