Can't restrict build to master-only



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:

      - 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?


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


That did the trick. Thanks.