Skip to main content

Configuring Branch and Merge Protection Rules in GitHub Cloud

Set Branch & Merge Rules

Support avatar
Written by Support
Updated over 4 months 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 settings, start by locating your app connection’s Git branch.

Navigate to your application connection’s Settings page.

Under the 'Version control' section, you’ll find the branch details.

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 app connection 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 app connection’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 app connection'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.

Additional Setup

Code Owners

To enable GitHub’s Code Owners feature and automatically assign pull request reviews based on file ownership, add a CODEOWNERS file to your branches via Tulip. Refer to the instructions here to update your app connection branch.
Learn more about the code owners feature in GitHub’s Code Owners documentation.

Did this answer your question?