Pipeline level branch filtering does not work as expected

In Pipeline Settings → Steps (beta)

When I specify branches like the following:

branches: "master
steps:
  - name: ":skull_and_crossbones:"
    command: "make clean"
  - name: ":rubocop:"
    command: "make test"

Other branches than “master” also get triggered.

So, right now I have to put branches in each step which looks repetitive when you have many steps.

steps:
  - name: ":skull_and_crossbones:"
    command: "make clean"
    branches: "master"
  - name: ":rubocop:"
    command: "make test"
    branches: "master"

But it is understandable because it is the Steps menu :grin:

Though what I am wondering is…
Is there any other way in YAML web ui to filer branch at pipeline level that I am missing?

Any help would be appreciated!

Thanks!

Hey there @zdk, and welcome to the forum — thanks for posting! :wave:t3:

First up, branches: BRANCH_NAME isn’t supported at the root level when defining a pipeline — it’s only supported at the step level, which is why your first example isn’t working how you expect.

You may be able to achieve what you want “Branch Limiting” though!

This will allow pipelines to only create builds that match the filter patter, and will ignore non-matching ones completely. You can find this setting under “Github” in pipeline settings — hopefully that will do what you want!

Cheers,
Justin

1 Like

Oh, OK nice. I’ll try the Branch Limiting.
Thanks for your reply.