Use of << pipeline.git.tag >> in workflows.$name.when

Following snippet doesn’t create pipeline, when I push tag, it still requires filters.tags specified on every job

workflows:
  version: 2
  deploy_uat:
    when:
      equal: [uat, << pipeline.git.tag >>]
    jobs:
      - build
      - deploy_uat
4 Likes

This is exactly what I am looking for.

I know that if I want to run multiple jobs in a workflow that is triggered by a tag, I need to set a filter for every job.

However, it is very inconvenient.

I would like to be able to omit redundant description only in the case of when in workflow.

prod-workflow:
    when:
        - matches: 
            pattern: "^v.*"
            value: << pipeline.git.tag >>

I’m trying something similar, and being similarly frustrated. I did find a snippet saying that circle does not run workflows on tags unless there is a tag filter associated on the jobs, which I assume is what is stopping me from making this work. I got rid of my when logic and placed the tag filter on every job inside the workflow and I got the desired behavior. But I really want to use the cleaner syntax of the when statement, I hope they support it soon.

This behavior isn’t what we would expect, we’re investigating and will report back.

1 Like

@salil having the same Issue! I wanted to use when but it does not work I am kind of forced to use filters.

Hi @salil , sorry for pinging but we’re also facing the same inconvenience. Do you have any updates on it?

I too am having this issue - has there been any movement on this?

Is there an update on this? It still doesn’t seem to work. As a workaround, I went the path of adding filters in each job where my workflow has three jobs where the third job requires the first two to succeed. Still no luck.

This is the filter I used for reference:

filters:
          tags:
            only: /^release\/.*/
          branches:
            ignore: /.*/

Currently, workflows only run when they have jobs with a tag filter. And only jobs with tag filter would run.
You can look more at the documentation about it here: Using Workflows to Schedule Jobs - CircleCI
We do believe that there is a necessity to develop a new feature that would make such use case easier. There is already a canny for that in here:
Allow tag filtering at workflow level | Cloud Feature Requests | CircleCI Ideas

1 Like

:wave: @ezbercihk ,

Just to be sure… Did you add the filters section to each job in the workflow, including the first two that that the third one requires?

Hey @FernandoAbreu and @yannCI , we did have another user add to an open issue in our docs repo: Scheduled Pipelines: can we continue to use regex branch filtering · Issue #6148 · circleci/circleci-docs · GitHub

They already see that they need to still also add filters to each job in the workflow. Are you able to replicate what they’re seeing with the breadcrumbs in the dashboard? Is that expected? Thanks.

@kat,

Yep, I’m seeing the same thing with regards to the breadcrumbs, after triggering a build with a tag.

It appears to only affect the workflow page; on the job page, the whole “branch” part is completely (and properly) skipped.