Skip to content

Use a job-level conditional/if to check command output #25081

Answered by Yanjingzhu
mrcnski asked this question in Actions
Discussion options

You must be logged in to vote

Output variable is inside a job. You could not use it in job-level condition.

Which trigger event do you use? If you are using on: push , you could get the last commit message in github.event context.

You could use next two conditions to filter commit message:

if:  startsWith( github.event.commits[0].message , 'Version change')  
if:  startsWith( github.event.head_commit.message , 'Version change')

Please see my example:

Replies: 2 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants