Skip to content

Enable “required status checks” for pull requests

Enabling GitHub’s required status checks for branch protection ensures that no pull requests are merged unless they are free of issues, automatically detected by the VIP Code Analysis Bot (the Bot). This enforces a workflow where pull requests require developers to get clearance from the VIP Code Analysis Bot before they can merge the code.

Note

By default, the VIP Code Analysis Bot is disabled for pull requests that are created by Codebase Manager from within the VIP Dashboard Plugins panel. Pull requests created by Codebase Manager will not be analyzed by the VIP Code Analysis Bot even in branches with a required status check enabled. Because of this conflict, the “Merge” button will not appear as expected. Only a user with a GitHub admin role can bypass the branch restrictions and merge the pull request.

Prerequisite

Users must have access to an application’s GitHub repository with a GitHub admin role for that repository in order to manage branch protection rules.

To enforce VIP Code Analysis Bot review, create a branch protection rule in GitHub and specify the VIP Code Analysis Bot commit status context:

  1. Navigate to an application’s GitHub repository. This URL can be found in the application’s VIP Dashboard.
  2. Under the repository name, select the Settings tab.
  3. In the “Code and automation” section of the sidebar, select Branches.
  4. Next to “Branch protection rules”, select Add rule.
  5. In the field below “Branch name pattern”, type the branch name or pattern to protect.
  6. Under “Protect matching branches”, enable “Require status checks to pass before merging“.
  7. (Optional but recommended) Enable “Require branches to be up to date before merging“. This ensures pull requests targeting a matching branch have been tested with the most recent code.
  8. In the search field, search for “VIP Code Analysis Bot” and select it in the results provided. This option will not be available if the Bot has not interacted with the repo in the past 7 days. This can be remedied by creating a or modifying an existing pull request.
Screen shot of the VIP Code Analysis Bot option in the status checks dropdown
  1. Select the “Create” button.

Last updated: May 29, 2024

Relevant to

  • WordPress