Workflow steps running despite tag filter specifying only

I have a project that is trying to run a specific step ONLY for git tag pushes, not regular commits. According to the docs, it sounds like the following should work:

    workflows:
      version: 2
      install-and-test:
        jobs:
          - test
          - build_optuna:
              filters:
                tags:
                  only: /^.+v[0-9]+$/    

e.g. the test job will run for every commit, while the build_optuna job will only run for tags ending with “v###”. However, the build_optuna job is seemingly being run on every single push, and not being run for git tag builds as expected.

Any suggestions?

Just to update, I did eventually find the tag build somewhere else in the UI (they weren’t showing up next to the other builds).

But I’m still seeing the build_optuna job firing on non tag builds, which seems like it shouldn’t be the case?

You have to add a branch filter to ignore all branches.

All branches build by default, no tags build by default.

1 Like

Ahh, thank you for this clarification, will update!

1 Like

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