Can't restrict build to master-only

2.0

#1

Using a CircleCI 2.0 yaml file, and not using workflows (at least I don’t think I’m using them, the string ‘workflow’ does not appear anywhere in my config.yml file, and there is no other file in the .circleci directory), I am not able to restrict the build to the master branch only, using the instructions in the documentation.

If I add the following:

build:
  branches:
    only:
      - master    

under the “jobs” key, it stops building ALL branches, including master.
Without that, it builds all branches.

How do I build on master only?


#2

It could be a bug, see here. The solution in that case was to use the workflows device and put the filter there instead.


#3

That did the trick. Thanks.


#4

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.