Created
December 19, 2023 17:02
-
-
Save mbjelac/8e7dd5c548fc18041062f0e174245034 to your computer and use it in GitHub Desktop.
How to reference step output in a subsequent step if clause
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test step output | |
on: | |
workflow_dispatch: | |
inputs: | |
fail_value: | |
description: 'Should fail on > 40' | |
required: true | |
type: number | |
default: 0 | |
jobs: | |
fail-on-step-output: | |
runs-on: ubuntu-latest | |
steps: | |
- name: set some output | |
id: out | |
run: echo "foo=${{ inputs.fail_value }}" >> $GITHUB_OUTPUT | |
- name: fail on output | |
if: steps.out.outputs.foo > 40 | |
run: exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment