Skip to content

feat(pr): add --exit-on-conflict to stop waiting on unmergeable PRs - #620

Open
adamyeats wants to merge 1 commit into
grafana:mainfrom
adamyeats:exit-on-conflict
Open

feat(pr): add --exit-on-conflict to stop waiting on unmergeable PRs#620
adamyeats wants to merge 1 commit into
grafana:mainfrom
adamyeats:exit-on-conflict

Conversation

@adamyeats

Copy link
Copy Markdown

A PR that conflicts with its base cannot merge without intervention, and GitHub runs no CI on it, so the pr wait sees an open PR with no failed checks and polls until the timeout. In pipelines where a conflicted PR means it was superseded by a newer write — automated deploy PRs updating one file, for example — the wait only delays the real outcome, and anything serialised behind the waiting workflow is blocked with it. We hit this with a rollout workflow holding a concurrency mutex for five hours against a deploy PR that a sibling pipeline had already superseded.

--exit-on-conflict (default false) exits with code 1 when GitHub reports the PR's mergeable_state as dirty on three consecutive polls. The consecutive-polls guard covers GitHub computing mergeability lazily, where a single poll can transiently report dirty while a background merge check runs. A clean observation resets the counter.

@adamyeats
adamyeats requested a review from a team as a code owner August 27, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant