Workflow branch filter not working

I’m trying to set up a build to only run on changes to a specific branch.

My workflow:

workflow:
  version: 2
  build_dev:
    jobs:
      - build:
        filters:
          branches:
            only: deploy/dev

But the build runs on every branch, not just “deploy/dev”. Am I doing something obviously wrong?

Thanks
–Steve

I think the only key takes a regex, not a plain string. Use a regex containing characters plus start/end delimiters, e.g.

only: #^deploy/dev$#

I’ve used something similar here.

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