Skip to main content
All CollectionsIntegrating Git and CI/CDGitHub Cloud
Configuring Branch and Merge Protection Rules in GitHub Cloud
Configuring Branch and Merge Protection Rules in GitHub Cloud

Set Branch & Merge Rules

Support avatar
Written by Support
Updated over 2 weeks ago

In GitHub, you can set branch protection rules in two ways:

  1. Using the new Rulesets feature

  2. Using the classic Branch Protection Rules interface

To configure these, you’ll first need to identify your environment’s Git branch, which is displayed in the Version Control section of the Environment Settings page in Salto’s UI.

Branch Ruleset Setup Instructions

  1. Navigate to the Settings tab of your GitHub repository and select the Rulesets section from the left-hand menu and click on 'New branch ruleset.

  2. Provide a ruleset name and make sure to activate it


  3. Ensure that the shared Git credentials for your environment have permission to push. For example, if these credentials have repository admin permissions, add a bypass for repository admins.


  4. In the Target Branches section, click on the Include by Pattern option and enter your environment’s branch name.



  5. For the remainder of the page, complete the fields according to your organization’s policies, for example:


    Ensure the following settings:

    • Enable Squash and Merge

    • Do not enable Signed Commits.

  6. Once finished, click the Create button at the bottom of the page.

Classic Branch Protection Rules Setup Instructions

When you navigate to the Settings tab of your GitHub repository and select the Branches section from the left-hand menu, you might notice the following callout:

Click on 'Add classic branch protection rule'
If you already have classic branch protection rules configured for this repository, click on 'Add rule'

  1. Type your environment's branch name under "Branch name pattern"

  2. Ensure that organization or repository administrators have permission to push

  3. For the remainder of the page, complete this according to your organization's policies.

Did this answer your question?