Navigation Menu

Skip to content

How do I know If workflow is triggered by git branch or git tag? #26731

Answered by eddiechenms
cytopia asked this question in Actions
Discussion options

You must be logged in to vote

You can use Context to access the information about the workflow run which will include the information you want. For information about trigger, you can use github context: github.ref. Usually, if the workflow is triggered by a tag, the value of github.ref would be something like “refs/tags/xxx”, and if the workflow is triggered by a branch, the value would be “refs/heads/xxx”. And then you can choose your next steps base on this information.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants