Change of Default Branch
Overview
You may change the default branch on your Version Control System (VCS) provider, and sometimes that change won't be reflected on CircleCI. This can cause issues with features that rely on knowing which branch is the default, such as GitHub status checks and Build Only Pull Requests.
How to Check the Current Default Branch
To view the current default branch for your project, use the following API endpoint:
Example
GET https://circleci.com/api/v1.1/project/{VCS}/{ORGNAME}/{PROJECT}/info
To retrieve the default branch information for a public CircleCI project, you can use this example:
GET https://circleci.com/api/v1.1/project/github/CircleCI-Public/circleci-cli/info
Updating the Default Branch
GitHub
CircleCI automatically checks the default branch and updates it for your project upon each commit pushed.
If you change the default branch in your GitHub settings, it will be updated on the next commit push to CircleCI.
Bitbucket
Currently, to update the default branch in a Bitbucket project, we have to manually refresh the project's information on your behalf.
Please submit a support ticket to request this update.
Note: This API endpoint is not supported for standalone organizations; those set up using the CircleCI GitHub App integration and CircleCI GitLab integration.
Comments
Article is closed for comments.