GitHub Action
Capture Output
v1
Latest version
Capture the output (and duration) of a command as a GitHub Actions output
or file
Required inputs:
cmd
: The Bash command you want to run
Optional inputs:
args
: A comma-separated list of arguments with which to run the commandhide-warnings
: Hide warnings in the GitHub Actions logs (defaults tofalse
)fail
: Fail the step if an error is detected (defaults totrue
)file
: The file to in which to record the output
Outputs:
output
: The full command output (stdout + stderr)stdout
: The result of stdoutstderr
: The result of stderrexit-code
: The command's exit codeduration
: The time the command took to run, in seconds
name: Capture output
on:
workflow_dispatch:
jobs:
capture-output:
runs-on: ubuntu-latest
steps:
- name: Capture output
uses: 'selfagency/capture-output@v1'
with:
cmd: yarn
args: run,build,--verbose
hide-warnings: true
fail: false
file: ${{ github.workspace }}/output.txt