Skip to content

Cancel a workflow without considering it failed? #27174

Answered by weide-zhou
jasonkuhrt asked this question in Actions
Discussion options

You must be logged in to vote

Hi @jasonkuhrt ,

It’s not supported, your workflow is cancelled from Rest API command, github will treat it as a failure one.

Typically we will use ‘if’ expression to skip some jobs/steps while not cancelling the whole workflow. 

Code sample as below:

- name: set output
        run: echo ::set-output name=ifpublish::$(jq -r '.kind' <<< $result)
        id: check
      - name: skip did not publish commits
        if: steps.check.outputs.ifpublish != 'did_not_publish'
        run: |
          publish steps....

Hope it helps!

Replies: 9 comments 1 reply

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
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
Comment options

You must be logged in to vote
1 reply
@ppaulweber
Comment options

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