Project:Emergency Guide for Bypassing Branch Protection Rules

From MaRDI portal

Recently, GitHub branch protection rules have been introduced to the MaRDI4NFDI. Each feature branch is required to be reviewed by at least one other developer in the project. This is to ensure code-quality and also to transfer knowledge directly at the base of the source-code.

However, there are emergency cases, where a push to the main branch is urgent, and no reviewers are available.

In these cases, the following steps can be taken:

1. Go to settings and then branches in the repository, edit branch rules and add your GitHub-Account id to the list of members who can bypass the branch-protection rules.

(This requires admin-role for the repository, at this point, if you don't have admin role request it by repo-members)

![Screenshot from 2022-01-13 14-39-15](

2. In some cases, even if you are admin, the name is not possible to add to the members. In these cases, at first disable enforce administrators, then add your name like in step one, then enable enforce administrators again. ![Screenshot from 2022-01-13 14-39-25](

3. Now go to the PR and make sure all checks have passed and merge conflicts have been resolved. You should now be able to see a checkbox which allows you to directly merge without a review approval. ![Screenshot from 2022-01-13 14-38-12](

4. If the PR has been merged, make sure to remove your name from the list of members who can bypass BPR.