Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 2

Using the output of `run:` inside of `if:` condition?

Solved! Go to Solution.

Is there any way to get the output of a `run:` script into the `if:` condition? The feature I'm basically looking for is a step output from `run:` but that doesn't look possible according to the documentation.

 

I've already gone the route of writing my own action to make a step with an output but it took a _lot_ of boilerplate because I needed to reauth with GitHub in the action, checkout the repository again, and do all my checks again in the action. I would have used [`actions/github-script`](https://github.com/actions/github-script/issues/8) but unfortunately the auth mechanism doesn't currently meet my use case and it seemed if I had access to `run:` stuff inside `if:` this whole thing would've been much easier to accomplish

1 Reply
Highlighted
Solution
Pilot Lvl 1
Message 2 of 2

Re: Using the output of `run:` inside of `if:` condition?

- id: id
  run: echo ::set-output name=key::value
- if: steps.id.outputs.key == 'value'

This should work.