Versão do artigo: Enterprise Server 2.17
Habilitar verificações de status obrigatórias
Os administradores de repositório podem impor verificações de status obrigatórias antes de fazer merge de um branch em uma pull request ou antes de fazer push de commits em um branch local para o branch remoto protegido.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, 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. Para obter mais informações, consulte "Configurar branches protegidos".
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 documentação do GitHub Developer.
- No GitHub Enterprise, navegue até a página principal do repositório.
- 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. Se selecionada, isso garante que o branch foi testado com o código mais recente no branch básico.
- From the list of available status checks, select the checks you want to require.
- Outra opção é selecionar Include administrators (Incluir administradores). This enforces all configured restrictions for repository administrators.
- Click Create.
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.