About GitHub Status Checks
GitHub status checks are an excellent way to track and control the CI/CD status of your projects. AutoRABIT will send status checks for the pull requests to your GitHub repo and allows you to control when pull requests can be merged based on the results of the CI job. AutoRABIT reports the status of workflows and all corresponding jobs under the Checks tab on GitHub.
Protected Branches are a feature in GitHub which lets you block merging pull requests into specific branches unless status checks have passed.
If you’re a repository owner, you can update your repositories using protected branches to use status checks per the following:
- Go to your repository’s Settings page.
- In the left-hand menu, click Branches.
- Under Branch protection rules either click Edit for a rule that you would like to change or click Add rule at the top to create a new rule.
- If adding a new rule, enter the desired branch name in the Branch name pattern field.
- Scroll down to the second box - Require status checks to pass before merging.
- From the build status checks in the last week of your repository, select one of them.
- Click Create.
To enable GitHub Checks
Enable the checkbox: Status Check API for your GitHub Repo under the Build section while creating a new CI job.
Whenever the job runs, AutoRABIT will automatically post the build status back to GitHub, referencing the relevant git commit and the outcome of the job (success or failure).
If a user selects CI deployment job (build and deploy), status check API is updated in the final step, i.e., after the build is successful and the deployment is completed.
If a user selects CI job to build only, status check API is updated after the build is completed.
Troubleshooting required status checks
- After you enable the required status checks, your branch may need to be up-to-date with the base branch before merging. This ensures that your branch has been tested with the latest code from the base branch. If your branch is out of date, you'll need to merge the base branch into your branch.
- The results of the deployment status in Github and the AutoRABIT application can sometimes be conflicting. While the deployment is still in progress in AutoRABIT, the status will be updated earlier on Github. This is due to the post-deployment activities being performed in AutoRABIT.