Protecting branches
Create branch protection rules to safeguard branches from inadvertent actions and
undesirable changes.
About this task
While role permissions let you manage which users have write and read access to decision automations, it might not be enough to protect your important branches of development. When a branch is protected, only users with the admin permission can share the changes they made in this branch or merge changes from another branch into the protected branch. Users who do not have the admin permission can continue to work locally in protected branches.
You can create a branch protection rule for a specific branch, all branches, or any branch that
matches a name pattern specified with fnmatch syntax:
- To protect a specific branch, enter the name of the branch. For example, to protect the
mainbranch, create a branch rule with the following pattern:main. - To protect any branch that contains a specific string, enclose that string in asterisks. For
example, to protect any branch containing the word
prod, create a branch rule with the following pattern:*prod*. - To protect all current and future branches in your decision automation, use the wildcard
character
*.
Procedure
- Click the Settings
icon in the toolbar at the top of your decision automation page to open the Settings menu.
- Open the Branch protection rules tab.
- Click Add +.
- Under Pattern, type the branch name or pattern that you want to
protect. Click the arrow next to the pattern name to see to the list of branches the pattern applies to.