Is there a way to build all PRs to specific branches and those branches themselves?



For example, suppose that I have following branches,

  • dev-branch (default branch)
  • prod-branch
  • random-branch
  • trying-to-make-sense-branch

and I have my own fork of this repository, with following additional branches,

  • important-feature-branch
  • beautiful-feature-branch

and now, I send a PR from important-feature-branch to dev-branch.
I want to build this PR, and dev-branch, and prod-branch.
However, I cannot find a way to do this.

  1. If I turn Only build pull requests setting on, CircleCI will not build prod-branch (which is not a default branch),
  2. If I set workflows[<workflow name>].jobs[<job name>].filters.branches.only to
    - dev-branch
    - prod-branch
    , job does not start with PRs.

Is there any way to resolve this situation? (a way to execute jobs in workflow for each commits of some branches and all PRs to those branches)


Is there anyone???


Same here, looking for alternatives to do something similar via CircleCI without turning to a “hacky” solution: for now what I’ve done is to open a PR from prod-branch to a dummy branch, and block that PR from being merged. But this is less than ideal since that means that for prod-branch to be deployed there has to be a permanent opened PR.


Same here. For libraries that support multiple branches (not only master), it would be interesting to get the same behavior for all supported branches, without losing the ability to run builds on PRs too.


I also need this. It isn’t very intuitive that opening a pull request to master behaves as expected, but opening a pull request in to any other branch does not.


Second this. Something similar would be to allow building for all PRs and their merged results. With the current setting, it is very hard to run a deploy job for a staging branch. If I want to deploy the staging branch, I need to open a PR to merge to master and then abandon it.


We need this as well, it would help small teams to keep the costs down