Enabling required status checks
Repository administrators can enforce required status checks before a branch is merged in a pull request or before commits on a local branch can be pushed to the protected remote branch.
Protected branches are available in public repositories with GitHub Free, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.
You can automatically enforce protected branch settings for some or all branches in your repository. For more information, see "Configuring protected branches."
Before you can enable required status checks, you must configure the repository to use the status API. For more information, see "Building a CI Server" in the GitHub Developer documentation.
-
On GitHub Enterprise, navigate to the main page of the repository.
-
Under your repository name, click Settings.
-
In the left menu, click Branches.
-
Next to "Branch protection rules", click Add rule.
-
Under "Branch name pattern", type the branch name or pattern you want to protect.
-
Under "Protect matching branches", select Require status checks to pass before merging.
-
Optionally, select Require branches to be up to date before merging. If selected, this ensures that the branch is tested with the latest code on the base branch.
-
From the list of available status checks, select the checks you want to require.
-
Optionally, select Include administrators. This enforces all configured restrictions for repository administrators.
-
Click Save changes.
Tip: To successfully merge a pull request into a base branch that has required status checks enabled, the pull request's head branch must be up-to-date with the base branch.