Build on Pull Requests and all commits


In some cases you may need to build when a pull request is opened and when a commit is pushed to every branch.

Building on Pull Requests 

In order to build when a pull request is opened, you will need to enable the Only build pull requests feature. Enabling this feature will build when a PR is opened and to commits to your default branch. 

Adding default branches 

You can view your projects default branch branch by using the get a Project API endpoint:

You may add additional default branches by leveraging the CircleCI API as mentioned in the following support article:

To add all branches as default branches, please add ".*" as a default branch. For example: 


curl -X PUT \
--header "Circle-Token: <token>" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{"feature_flags":{"pr-only-branch-overrides": "main, .*"}}' \


Additional Resources: 

Was this article helpful?
0 out of 1 found this helpful



Article is closed for comments.