github-community-projects / github-community-projects/safe-settings
Enabling branch protection based on the branch patterns.
- Dominant language
- JavaScript
- Stars
- 921
- Forks
- 226
- Avg merge
- 18h 3m
- Merged PRs (30d)
- 14
Description
## Prerequisites:
* Is the functionality available in the GitHub UI? If so, please provide a link to information about the feature.
Yes, from github UI, I can enable branch protection rules on pattern like `*-release` which will apply these rules to all the branches with `-release` as the suffix.
* Is the functionality available through the GitHub API? If the functionality is available, please provide links to the
API documentation (https://developer.github.com/v3/) as well as the Octokit documentation (https://octokit.github.io/).
Yes, this is available via github graphQL api **ONLY**. https://docs.github.com/en/graphql/reference/mutations#createbranchprotectionrule
https://docs.github.com/en/graphql/reference/input-objects#createbranchprotectionruleinput
* If the functionality is not yet available in the API, it would be helpful if you
contacted support (https://support.github.com/) or posted in the Community Forum (https://github.community/). Please
include a link to the forum post if you create one or a copy of the response from support.
## New Feature
Please describe the desired new functionality:
I want to enable branch protection rules based on a pattern. Today we can achieve this via Github UI and github graphQL apis. Adding this feature will help us to manage branch protection will less rules.
Contributor guide
Assessment
This issue has not been assessed yet.