Tag-only workflow jobs not working

I am attempting to make a singular workflow (not my preference but I dislike repeating entire workflows just for slight variations) which has a publish job at the tail end, which only triggers via tags matching /v.*/. My problem is undoubtedly my workflow’s previous jobs (which Publish requires as dependencies), but I’m not sure how they’re blocking it from running.

Here’s a workflow that works fine when I push a tag:

:+1: :+1: :+1:


        'Test':
            jobs:
                - 'Checkout':
                    filters:
                        tags:
                            only: /^v.*/ 
                        branches:
                            ignore: /.*/ 

And this fails :-1: :-1: :-1:

    'Build':
        jobs:
            - 'Checkout' # should run for tags
            - 'Dependencies': # should run for tags
                  requires:
                      - 'Checkout'
            - 'PR check': # should not run for tags
                  requires:
                      - 'Dependencies'
                  filters:
                      tags:
                          only: /.*/
                      branches:
                          only: /^pull\/.*$/
            - 'Build': #should run for tags
                  requires:
                      - 'Dependencies'
                  filters:
                      tags:
                          only: /.*/
                      branches:
                          only: /^(?!pull\/).*$/ # only from canonical repository
            - 'Test': # should not run for tags
                  requires:
                      - 'Build'
                  filters:
                      branches:
                          only: /^(?!pull\/).*$/
            - 'Publish': # absolutely needs to run for tags
                  requires:
                      - 'Build'
                  filters:
                      tags:
                          only: /^v.*/ 
                      branches:
                          ignore: /.*/ 

I thought I was following the guidelines by declaring filters for all dependent jobs but it never triggers the workflow. Any ideas? Thanks!

1 Like

Well, I found a workaround. Maybe this is as-intended but it is unintuitive to me as I don’t believe that dependent jobs with no filters should not block child jobs with filters.

I fixed it by specifying “allow all” filters for tags:

            - 'Checkout':
                  filters:
                      tags:
                          only: /.*/ # ensure this job does not block publishing via tag
            - 'Dependencies':
                  requires:
                      - 'Checkout'
                  filters:
                      tags:
                          only: /.*/ # ensure this job does not block publishing via tag

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