docs
docs copied to clipboard
branch protection documents don't talk about `conflict`s between protection rules
Code of Conduct
- [X] I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule#about-branch-protection-rules
What part(s) of the article would you like to see updated?
Something should mention that one can't have two branch protection rules that match the same branch, or if one can, it should explain how priority works.
Searching for conflict only shows hits for merge conflict.
Note: it appears impossible to deep link to any of the steps in https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule#creating-a-branch-protection-rule which means I can't link to:
Under "Branch name pattern", type the branch name or pattern you want to protect.
Offhand, text should probably be included here warning that one should work to avoid having patterns in branch protection rules that conflict.
Additional information
https://github.com/github/feedback/discussions/12257
@jsoref Thanks so much for opening an issue! I'll triage this for the team to take a look :eyes:
Thanks @jsoref, I believe the answer to your question is here:
https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule#about-branch-protection-rules
If a repository has multiple protected branch rules that affect the same branches, the rules that include a specific branch name have the highest priority. If there is more than one protected branch rule that references the same specific branch name, then the branch rule created first will have higher priority.
Was there something else you had in mind? Feel free to re-open if I'm misunderstanding!
Offhand, text should probably be included here warning that one should work to avoid having patterns in branch protection rules that conflict.
I don't think this is something we would recommend.
Interesting, then why does the UI tell me I have a conflict?
At the very least, that text should have the word conflict so that users hitting the error message can find the documentation.
Great question! I agree that we could address what that "conflict" means in the UI... but I must admit, I don't actually know. Let's see if we get some answers in that feedback issue, so we know what to add.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. See this blog post on bug reports and the importance of repro steps for more information about the kind of information that may be helpful.
@lecoursen not even a nibble
@cmwilson21 can you please find someone who could comment?