Skip to content

feat: pull request policy shared by every repository - #7

Merged
its-janghoon merged 1 commit into
mainfrom
chore/pr-policy
Oct 12, 2026
Merged

its-janghoon merged 1 commit into
mainfrom
chore/pr-policy

Conversation

@its-janghoon

Copy link
Copy Markdown
Member

What this changes

Adds a reusable pull request policy workflow, its caller template, and the matching CONTRIBUTING section (en, ko).

Why

One member has opened 428 pull requests across the org in 30 days with 184 review requests to the maintainer. GitHub has no native control for either (interaction limits do not apply to members; there is no "self-review first" rule), so a workflow enforces both:

  • at most 3 open pull requests per author per repository: the oldest 3 stay, a newer one is closed on opening;
  • a review request to its-janghoon is removed until the author has reviewed their own pull request and ticked every box in the description.

its-janghoon and dependabot[bot] are exempt. Each repository gets a 14-line caller (follow-up PRs).

How it was verified

  • YAML parsed with PyYAML; the run script extracted and passed bash -n and shellcheck.

  • Dry run against the live redrob-labs/redrob-code (writes stubbed): with 4 open PRs by the author, #75/#76/#77 are kept and #78 would be closed; exempt author short-circuits; a request to a non-gated reviewer or a team is ignored; #78 with 0 self-reviews would have its request to its-janghoon removed.

  • Not exercised: the real pull_request_target run, which needs this file on main first. The first caller PR in a product repository is the live test.

  • The repository's own gates pass locally

  • Verified against the built artifact, not only the diff

  • No credential, token or .env file in the diff

  • User-facing strings go through the translation layer, in both locale tables

Two rules enforced by a reusable workflow, called from each repository through
pull_request_target so it runs the base branch's copy with write access:

- Open-PR cap. An author keeps at most three open pull requests per repository.
  The oldest three stay; a newer one is closed on opening or reopening with a
  comment naming the ones that stay. Ranking by number (not a plain count) keeps a
  burst of simultaneous openings from closing all of them.
- Review-request gate. A review request to a maintainer is removed until the
  author has reviewed their own pull request (one review of any state) and the
  description has no unchecked box. One comment per PR, updated in place.

Exempt logins and the gated maintainer list are inputs with org defaults.

Also a workflow template for the caller and a CONTRIBUTING section (en, ko).
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