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:
'Test':
jobs:
- 'Checkout':
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
And this fails
'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!