Skip to content

ENH: add branch-creation restriction to gh-protect-branch#15

Merged
Thomas A Caswell (tacaswell) merged 1 commit into
NSLS2:mainfrom
stuwilkins:gh-restrict-creation
Jul 22, 2026
Merged

ENH: add branch-creation restriction to gh-protect-branch#15
Thomas A Caswell (tacaswell) merged 1 commit into
NSLS2:mainfrom
stuwilkins:gh-restrict-creation

Conversation

@stuwilkins

Copy link
Copy Markdown
Contributor

Add --restrict-branch-creation and --only-restrict-creation to apply
an additive nsls2-restrict-branch-creation ruleset targeting ~ALL branches,
blocking creation of names outside --exclude-branches (default main,preview;
fnmatch, auto-prefixed refs/heads/). Validate --approvers team via API
before applying (GitHub silently ignores unknown dismissal teams; requires
read:org scope). Guard against empty --exclude-branches patterns. Document
exit codes accurately. Rebased onto current main; conflict resolution
preserved bash>=4 guard from ad7eca9 and pemdecompose row from upstream.

Assisted-by: opencode:claude-opus-4-8
Assisted-by: opencode:claude-sonnet-4-6
Assisted-by: opencode:gpt-5.6-sol

Add --restrict-branch-creation and --only-restrict-creation to apply
an additive nsls2-restrict-branch-creation ruleset targeting ~ALL branches,
blocking creation of names outside --exclude-branches (default main,preview;
fnmatch, auto-prefixed refs/heads/). Validate --approvers team via API
before applying (GitHub silently ignores unknown dismissal teams; requires
read:org scope). Guard against empty --exclude-branches patterns. Document
exit codes accurately. Rebased onto current main; conflict resolution
preserved bash>=4 guard from ad7eca9 and pemdecompose row from upstream.

Assisted-by: opencode:claude-opus-4-8
Assisted-by: opencode:claude-sonnet-4-6
Assisted-by: opencode:gpt-5.6-sol
@tacaswell
Thomas A Caswell (tacaswell) merged commit c899df9 into NSLS2:main Jul 22, 2026
1 check passed
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.

2 participants