https://github.com/selfagency/capture-output
Capture the output (and duration) of a command as a GitHub Actions output or file
https://github.com/selfagency/capture-output
github-actions
Last synced: 6 months ago
JSON representation
Capture the output (and duration) of a command as a GitHub Actions output or file
- Host: GitHub
- URL: https://github.com/selfagency/capture-output
- Owner: selfagency
- License: mit
- Created: 2022-09-19T18:40:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-01T07:49:07.000Z (about 1 year ago)
- Last Synced: 2025-04-10T10:39:26.290Z (6 months ago)
- Topics: github-actions
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/capture-output
- Size: 367 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Capture Output Action
Capture the output (and duration) of a command as a GitHub Actions `output` or file
## How to use this Action
Required inputs:
- `cmd`: The Bash command you want to run
Optional inputs:
- `args`: A comma-separated list of arguments with which to run the command
- `hide-warnings`: Hide warnings in the GitHub Actions logs (defaults to `false`)
- `fail`: Fail the step if an error is detected (defaults to `true`)
- `file`: The file to in which to record the outputOutputs:
- `output`: The full command output (stdout + stderr)
- `stdout`: The result of stdout
- `stderr`: The result of stderr
- `exit-code`: The command's exit code
- `duration`: 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
```