Skip to content

When should I use both "github.event_name == 'push'" and "startsWith(github.ref, 'refs/tags')"? #223

Answered by webknjaz
catanzaromj asked this question in Q&A
Discussion options

You must be logged in to vote

The additional clause does not appear on packaging.python.org docs.

That tutorial shows the use of on: push. So when the workflow is triggered, the event is always push. In case of additional events that may trigger it, you may want to differentiate explicitly. I personally like to set it up in a way that building the dists happens first, then those dists are tested and only after that, the publishing happens. In that case, it's useful to have the publishing job skipped when merging to main or running for pull requests. Some people make releases without testing in between and may even rely on a trigger like release, not skipping other jobs.

I like using the workflow_dispatch trigger tha…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by webknjaz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants