Closed
Description
Currently, in the branch protection settings, "Protected file patterns" can be configured:
I propose to add support for configuring the counterpart of this: "Unprotected file patterns".
Users with write access to the repo should be able to push commits that only touch unprotected files directly to the otherwise protected branch.
Activity
lafriks commentedon Jul 9, 2021
It could probably be added as selection on what behavior is expected for patterns matching
jpraet commentedon Jul 9, 2021
What if we want to configure both protected file patterns AND unprotected file patterns though?
lafriks commentedon Jul 14, 2021
They would be conflicting imho, how that would work?
jpraet commentedon Jul 15, 2021
I think they are complementary. For example:
/LICENSE.md
/docs/**
And protected_file_patterns takes precedence: when a changed path matches both protected_file_patterns and unprotected_file_patterns, it will be treated as protected.
lafriks commentedon Jul 15, 2021
But if I understand correctly that if I have write to the repo and there is unprotected_file_patterns set like in your example I would not be able to modify
/LICENSE.md
anyway even with noprotected_file_patterns
set as I can only modify files in/docs/
directory.jpraet commentedon Jul 15, 2021
With unprotected_file_patterns, people with write access to the repo can modify those files even if they are not allowed to push directly to the branch. It is to allow to bypass the PR workflow.
Support unprotected file patterns (#16395)