The intake workflow re-closes a reopened PR whose author is still over the
open-PR limit, so a maintainer cannot rescue PRs it auto-closed. When the
reopening actor has write, maintain or admin permission, skip the limit and
remove the "open PR limit" label instead. Contributor reopens behave as
before, and if the permission lookup fails the limit still applies.
pr-intake runs once per opened PR, and each run lists every open PR by
the author. When an author opens several PRs within seconds, every run
sees all of them and closes its own, so a newcomer opening two PRs at
once loses both, and an author with one merge opening 21 loses all 21.
On opened events the limit now counts only lower-numbered PRs, so the
earliest ones stay open and only the PRs over the limit are closed.
Reopened events still count every open PR, as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012zyXkUzTZGh3nBwNMtrLaW
Authors with no merged pull requests can have 1 open, with at least 1
merged 20, and from 20 merged there is no limit. Reopening a pull
request runs the check again.
Co-Authored-By: Claude <[email protected]>