Can we allow a job to fail in a workflow?

github
workflow

#1

Is there any way to allow a single job to fail in a workflow without having a red X as a GH status? I noticed several closed Issues with no response on this topic.

More specifically, many automated build tools have an “allowed_failure” key. Is there any similar functionality or finer status control?


#2

This is not supported.


#3

Thanks for the response! Are there any plans to support allowed failures?


#4

@KPrasch This has already been put forward, so you can go ahead and vote for it as well as put your use case in the comments.


#5

Thank You!


#6

I just thought of a workaround for you that while not pretty and probably not suitable in certain cases may get you out of trouble. You could either do something like this:

steps:
  - run: 
      name:
      command: |
        set -o errexit
        tox
        set -o errexit

You’ll need to do this for every step where you require this, an alternative is to do this:

steps:
  - run: 
      name:
      command: |
        scripts/shell_script_that_calls_tox_test_runner.sh

I wondering if maybe there might even be something doable with the orbs feature in the 2.1 config that’s currently in preview. I’m thinking if the parameterisation is somehow able to be substituted into the command then it can be wrapped by setting the shell options to control how it handles non zero status returns for your commands.


#7

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.