Skip to content

Navigation Menu

Sign in
Sign up
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Command Output Action

Continuous Integration CodeQL

A run alternative that stores command output in a variable.

Inputs

run

Required The command to run.

shell

The shell used to run command.

Outputs

stdout

The output of the command written to stdout.

stderr

The output of the command written to stderr.

Example usage

Store today's date in variable

steps:
- name: Get today's date
 uses: StarUbiquitous/command-output@v1.0.0
 id: today
 with:
 run: date +'%Y-%m-%d'
- run: echo Today is ${{ steps.today.outputs.stdout }}

Use stdout and stderr output as condition

steps:
- name: Read file if it exists?
 uses: StarUbiquitous/command-output@v1.0.0
 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 }}

About

GitHub action that runs a command and store its output

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /