-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wildcard Protected Branch #2529
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
there are news about this feature? |
I'm thinking to work on this for 1.11 version |
thank you @lafriks |
I think that should be a separate issue / pr to not make this too big. It need to consider some thing, like should it be a default branch setting that can be changed or deactivated in each repository? With wildcard support it is possible that several settings match one branch, so the priority / combination of different branch protections need to be considered. Should only the first matching branch be used (means it must be possible to order them) or the most restrictive or the most permissive setting be used? What if there are different users/teams configured in different matching branch protection settings? |
This is a very useful feature especially if it can be set at the organization level. |
@mbarinc if someone has a PR for 1.12 or is working on it? |
@6543 I think no PR for this currently. |
@lafriks any news about this, it should be really cool to get this feature especially for organizations |
I would like to bump this issue. Having a wildcard on |
I will take a look at it, if I can help ! |
I need this to. Especially for |
I'm interested too, it can be very usefull for repos with dozens of branches, that need to be protected |
Until I find some time on this, I made a workaround with a webhook and some api calls... it's quite fast and reliable ! |
@99rgosse can you explain your setup. It's kind of dangerous without. |
Hello @frankhommers here is the repository : https://github.com/99rgosse/branch_protection |
This PR introduce glob match for protected branch name. The separator is `/` and you can use `*` matching non-separator chars and use `**` across separator. It also supports input an exist or non-exist branch name as matching condition and branch name condition has high priority than glob rule. Should fix #2529 and #15705 screenshots <img width="1160" alt="image" src="https://user-images.githubusercontent.com/81045/205651179-ebb5492a-4ade-4bb4-a13c-965e8c927063.png"> Co-authored-by: zeripath <art27@cantab.net>
With the last version, you could only protect branches that exists. But I think it should also be possible to protect branches given as wildcard (similar to GitLab),
e.g.
pu/*
release/*
*-stable
{user}/* (this branch should be protected except {user}
I think it would be a good idea to set these attitudes globally for an organization.
The text was updated successfully, but these errors were encountered: