Repository navigation
Let the PR creation cap count draft pull requests - #139
Merged
Merged
Conversation
GitHub's pull request creation cap only counted open, non-draft pull
requests, so a user held to a cap could still open any number of drafts
-- the loophole that automated PR floods use. GitHub now lets the cap
count drafts too, exposed as the `include_drafts` field on the existing
PATCH /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap
endpoint (changelog 2026-10-08).
Add an optional `include_drafts` boolean under
github.pull_requests.creation_cap and send it with the PATCH when the
cap is enabled. When it is omitted it is left out of the payload, so a
value set by hand in the repository settings is not overwritten. When a
previous .asf.yaml set it and the current one drops it, send `false`,
so removing the key reverts the setting instead of leaving it stuck.
Generated-by: Claude Opus 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub now lets the pull request creation cap count draft PRs. Before this, a user held to a cap could open any number of drafts. GitHub exposes this as an optional
include_draftsboolean on thePATCH /repos/{owner}/{repo}/interaction-limits/pulls/creation-capendpoint, whichpr_creation_capalready calls.This adds
github.pull_requests.creation_cap.include_drafts:.asf.yamland dropped now →falseis sent, so removing the key reverts it.README updated; six unit tests added.
pytest(165 passed) andpre-commit run --all-filesare clean.Sandbox test against
potiuk/infrastructure-asfyaml-sandboxatd537e97, verified by reading the creation-cap endpoint back after each run ({enabled, max_open_pull_requests, include_drafts}):{false,7,false}include_drafts: true{false,7,false}{true,3,true}false{true,3,true}{true,3,false}trueset by hand{true,3,true}{true,4,true}enabled: false{true,4,true}{false,4,true}Not covered in the sandbox: the "key removed after it was set" path, because the previous
.asf.yamlcache doesn't exist outside production. Unit tests cover it. The sandbox was reset to baseline afterwards.🤖 Generated with Claude Code