I want to configure a workflow so that it runs only for pushes which change specific paths or always for pushed tags. Some testing showed that if I have a config like:
on: push: paths: - 'src/**'
then this workflow will run on changes that include anything under src/** (as expected), but it will also run on a tag push, even if the commit for this tag has no changes to src/**. The last part is unexpected, but actually exactly the behavior I want. Are my assumptions correct and can I rely on the workflow getting executed on tag pushes?
Further, can I limit this to specific tags like this:
on: push: paths: - 'src/**' tags: - 'release-*'
Again the expectation would be that this runs on any pushes that change the specified paths, but also on any tag pushes for tags matching the pattern. I would not expect this to run for tags that do not match the pattern. Is this second assumption correct?
The existing documentation quite clearly illustrates how to use either path or tags, but not how those options work in combination.