pr-merge: don't tell the caller to just un-draft a PR that isn't theirs

This commit is contained in:
damocles 2026-08-13 15:14:34 +02:00 committed by mara
commit b4e56b964f

View file

@ -134,8 +134,12 @@ fn check_ready(client: &Client, repo: &str, number: u64, pull: &PullRequest) ->
// others (rebasing a draft does nothing). Only name the
// cause when the API actually confirms it (draft); otherwise report
// the bare observation and let `pr-status` be consulted for detail.
// Report the confirmed cause without prescribing the fix — a draft
// can be a deliberate signal (from the author, or the operator)
// rather than an oversight, so don't tell the caller to just
// undraft it if it isn't theirs to undraft.
Some(false) if pull.draft.unwrap_or(false) => bail!(
"pr-merge: PR #{number} is a draft, not mergeable. Mark it ready for review, or pass --force."
"pr-merge: PR #{number} is a draft, not mergeable. Pass --force, or check with whoever set draft before un-drafting it."
),
Some(false) => bail!(
"pr-merge: PR #{number} is not mergeable. Check `pr-status --pr {number}` for detail, or pass --force."