Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 3

Using exit code of previous step

Solved! Go to Solution.

So I know you can use output of steps by referring to `steps.<step id>.outputs.<output name>`.

 

Is it also possible to use exit code of previous step?

 

Pseudo code:

 

    steps:
      - id: example
        uses: repo/some-external-action@master
      - if: steps.example.exitcode > 0
        run: echo "Something went wrong"
2 Replies
Solution
Pilot Lvl 1
Message 2 of 3

Re: Using exit code of previous step

- if: failure()
- if: success()

This is the only solution to know if Action step completed successfully or not that I know.

Copilot Lvl 3
Message 3 of 3

Re: Using exit code of previous step