I'm using CODEOWNERS file on Github to setup automatic pull-request reviewers based on files/folders. The system works well and reviewers get added automatically to pull-requests.
However, I want to limit this setup just for release branches, and not for private branches. When a private branch is taken off of a release branch, it also gets the CODEOWNERS
file and in turn all the "automatic reviewers for pull-requests" setup.
Is there a way to make sure that the CODEOWNERS
file applies only to specific branches? Or a way to make sure that this particular file doesn't get synced to other branches at all?
You can enforce pull request reviews from CODEOWNERS based on branches.
In your Repo, Go to:
Settings -> Branches -> Add Rule -> Apply rule to <your branch>
.
Then mark Require pull request reviews before merging -> Require review from Code Owners
This will make sure the rule only applies to that specific branch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With