Repository navigation
ci: limit each contributor to one open draft PR - #1519
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughAdds a GitHub Actions workflow that calls a pinned reusable workflow when a pull request is opened, reopened, or converted to draft. The job grants pull request write permission and sets the maximum draft count to one. ChangesDraft Limit
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Merge Risk: ⚪ Minimal · up to The workflow applies the one-draft limit without running contributor code with its write token. No actionable merge-blocking risk is established. Architecture SummaryArchitecture risk: 🔵 Low · up to The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency. Changed systems: None identified. Architecture concerns Review detailsBefore / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
<!-- entire-trail-link-start --> https://entire.io/gh/jdx/usage/trails/58 <!-- entire-trail-link-end --> ### ⚡ Performance - reduce development debug info by [@jdx](https://github.com/jdx) in [#1525](#1525) ### 🧪 Testing - **(lib)** support independently enabled optional features by [@jdx](https://github.com/jdx) in [#1513](#1513) ### 🛡️ Security - restrict AI replies on Discussions and Issues and note the instant ban by [@jdx](https://github.com/jdx) in [#1522](#1522) ### 🔍 Other Changes - **(entire)** store checkpoints in a private repository by [@jdx](https://github.com/jdx) in [190ff3e](190ff3e) - **(entire)** commit codex session hooks by [@jdx](https://github.com/jdx) in [abee1b8](abee1b8) - **(entire)** commit claude session hooks by [@jdx](https://github.com/jdx) in [364d74e](364d74e) - **(entire)** restore lower-cost trail findings by [@jdx](https://github.com/jdx) in [2f2f991](2f2f991) - limit each contributor to one open draft PR by [@jdx](https://github.com/jdx) in [#1519](#1519) - add hk pre-commit hook by [@jdx](https://github.com/jdx) in [#1523](#1523) - update pr-closer policy by [@jdx](https://github.com/jdx) in [a2608b7](a2608b7) ### 📦️ Dependency Updates - update ubuntu:26.04 docker digest to da6fc2b by [@renovate[bot]](https://github.com/renovate[bot]) in [#1514](#1514) - update jdx/renovate-config action to v1.0.1 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1515](#1515) - update mise tools to latest by [@renovate[bot]](https://github.com/renovate[bot]) in [#1516](#1516) - update dependency communique to latest by [@renovate[bot]](https://github.com/renovate[bot]) in [#1518](#1518) - update dependency aube to latest by [@renovate[bot]](https://github.com/renovate[bot]) in [#1520](#1520) - run go mod tidy on Renovate branches by [@jdx](https://github.com/jdx) in [#1521](#1521) - update module github.com/urfave/cli/v3 to v3.13.0 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1517](#1517) - lock file maintenance by [@renovate[bot]](https://github.com/renovate[bot]) in [#1524](#1524) - update dependency golangci-lint to v2.14.0 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1526](#1526) - update jdx/mise-action action to v5 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1527](#1527)
https://entire.io/gh/jdx/usage/trails/65
Stops an outside contributor from leaving several draft pull requests open at once. GitHub has no setting that caps a contributor's open PRs, so this adds a small workflow that enforces it.
When a draft PR is opened, reopened, or converted back to a draft, the workflow counts the author's other open drafts. If they already have one, it closes the new draft with a comment:
max_drafts(default 1) in the caller.The logic lives in the shared jdx/workflows repo and is pinned to v1.0.0, so Renovate will keep it current. The trigger is
pull_request_targetbecause fork PRs only get a write token there; the workflow never checks out or runs the PR's code, and thezizmor: ignore[dangerous-triggers]in the file records that.Validation: actionlint and zizmor (including the online audits) pass, and the decision logic was exercised against a stubbed
ghfor the open/reopen/convert/exempt/race cases. It has not yet run against a real outside contributor's PR.AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: 2.1.284.
🤖 Generated with Claude Code
Note
Medium Risk
Uses
pull_request_target, which is sensitive, but scope is limited to commenting/closing draft PRs via a pinned reusable workflow without checking out fork code.Overview
Adds a new GitHub Actions workflow draft-limit that caps each outside contributor to one open draft PR at a time.
On
opened,reopened, orconverted_to_draft, it delegates to the pinned shared workflowjdx/workflows(v1.0.0) withmax_drafts: 1. If the author already has another open draft, the workflow comments and closes the newer draft; ready-for-review PRs are not affected. The job usespull_request_target(with a zizmor ignore) so fork PRs getpull-requests: writefor comment/close only—the caller does not check out or run PR code. Repo members and bots are handled in the shared implementation.Reviewed by Cursor Bugbot for commit 0d7016c. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit