A run
alternative that stores command output in a variable.
Required The command to run.
The shell used to run command.
The output of the command written to stdout.
The output of the command written to stderr.
steps:
- name: Get today's date
uses: mathiasvr/[email protected]
id: today
with:
run: date +'%Y-%m-%d'
- run: echo Today is ${{ steps.today.outputs.stdout }}
steps:
- name: Read file if it exists?
uses: mathiasvr/[email protected]
continue-on-error: true
id: cmd
with:
run: cat unknown.txt
- run: echo Command succeeded
if: ${{ steps.cmd.outputs.stdout }}
- run: echo Command failed
if: ${{ steps.cmd.outputs.stderr }}