ci: limit contributors to 2 open pull requests (#26)

Call the shared floci-io/.github pr-limit workflow on opened, reopened and
ready_for_review, and on closed and converted_to_draft to clear stale
labels. Runs for the same pull request queue rather than cancel, and manual runs use their own concurrency group. Contributors
keep at most 2 open, non-draft pull requests: the 3rd and 4th get the
over-pr-limit label and a reminder, and from 2026-10-08 the 5th and later
are closed automatically. Bots and maintainers are exempt.

CONTRIBUTING.md and the pull request template describe the policy.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-10-01 17:44:24 -05:00
1 parent f11ce0597a
commit 248d7a67f6
3 files changed
+56

No files matched your search

+1
View File
@@ -25,3 +25,4 @@
- [ ] `README.md` updated (if a command or flag changed)
- [ ] Native binary verified (`mvn package -Pnative`) — required if Jackson serialization or dependencies changed
- [ ] Commit messages / PR title follow [Conventional Commits](https://www.conventionalcommits.org/) — a `feat`/`fix`/`perf` subject becomes the release note, so `CHANGELOG.md` needs no hand edit
- [ ] I have no more than 2 open, non-draft pull requests in this repository (maintainers and dependency bots are exempt).
+44
View File
@@ -0,0 +1,44 @@
name: PR Limit
# Open-PR limit for contributors (see CONTRIBUTING.md, "Pull Request Limits and Review
# Bandwidth"). The logic, limits and wording live in the shared reusable workflow in
# floci-io/.github; this file only wires the events to it.
#
# pull_request_target gives the token write access on fork PRs. Neither this workflow
# nor the reusable one checks out or runs PR code; they only call the GitHub API.
on:
pull_request_target:
# closed and converted_to_draft only remove stale over-pr-limit labels.
types: [opened, reopened, ready_for_review, closed, converted_to_draft]
# Manual hook: evaluate any open PR. Dry run by default, so it only logs the decision.
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to evaluate'
required: true
dry_run:
description: 'Only log what would happen'
type: boolean
default: true
permissions:
issues: write
pull-requests: write
concurrency:
# github.ref is the base branch under pull_request_target, so key on the PR number;
# otherwise every PR run would cancel every other. Manual runs get their own group:
# GitHub keeps only one pending run per group, so sharing it would let a manual dry
# run replace a live evaluation waiting in the queue. Live runs for the same PR queue
# rather than cancel; a newer live event may replace an older pending one, which is
# fine because it evaluates the PR's current state.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || inputs.pr_number }}-${{ github.event_name == 'workflow_dispatch' && 'manual' || 'live' }}
cancel-in-progress: false
jobs:
pr-limit:
uses: floci-io/.github/.github/workflows/pr-limit.yml@main
with:
pr-number: ${{ format('{0}', github.event.pull_request.number || inputs.pr_number) }}
dry-run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }}