How to run job if tag is versioned, for example v1.2.3?
You can use an
on.push.tags filter in the workflow, probably something similar to this:
on: push: tags: - 'v*'
This solution is for whole workflow. The question is how to make condition by tag for specific job of workflow.
Oh, right! In that case you could try to build an
if condition for the job that checks
github.event.ref, maybe something like this:
if: startsWith(github.event.ref, 'refs/tags/v')
That’s assuming the job will only be called for push events, otherwise you’d have to check the event type first.
It seems it is solution. Thank you!
I’ve tested with
There is missing documentation what the ref means https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context