Run additional command if the first one fails

Hi, I’m migrating jobs from CircleCi. We have one job with two commands:

      - run:
          name: Step 1
          command: Command 1
      - run:
          name: Report Issues to GH
          command: Command 2
          when: on_fail

What is the correct equivalence in Buildkite? I tried several options but I would like to include it in the same Job.


Hi @inakivi! :wave:

Welcome to the community! :blush:
You’ll probably be interested in checking out our getting command step, and particularly there is an example for situations like this.

I hope this helps!