This project uses Git-Hub as the repo provider.
The main branch is master.
There's a configured rule for master, like:
and..
The master branch is blocked for direct pushes. Nobody can push directly to it.
Push to master is only allowed after approved PR's and is done via Git-Hub site.
Every developer needs to create a new branch to change the code and create a PR to push the changes to master only after PR is approved.
New branches can have the following prefixes: feature/xxxxx || bugfix/xxxxx || fix/xxxxx || enhancement/xxxxx.
ThereĀ“s a codeowners file on the project where GitHub will read after the PR created and will ask for approve of the users configured inside that.
After the PR approved and the push to master is done, the web-hook to Jenkins will trigger the CI / CD to start.
If the deploy is done successfully, delete the new branch.
Update the Master branch before create another new branch.
Iterate..
Create a new rule in GitHub ( See the introduction block before ).
Test and check if it works - check the video under ( video with a git simple example, where I have a code owner @jfgomes and a contributor user that is not on the code owner's list called jfgomes2 ):