GitXplorerGitXplorer
m

command-output

public
44 stars
10 forks
8 issues

Commits

List of commits on branch main.
Unverified
6309e0ee6ed594fd7f382bd826e138e0ba04dd63

docs: Update docs

mmathiasvr committed 2 years ago
Unverified
34408ea3d0528273faff3d9e201761ae96106cd0

2.0.0

mmathiasvr committed 2 years ago
Unverified
251ff96464a5045c50ecbed50c9f1e27a7aa7b13

test: Fix tests

mmathiasvr committed 2 years ago
Unverified
35ff8f25069fbdcfa084f3b8fbda812da9733af8

build: Build distribution

mmathiasvr committed 2 years ago
Unverified
5a63257020e1cd4f4f5a39fd5825bb244d815667

chore: Update dependencies

mmathiasvr committed 2 years ago
Verified
1bdb45d4ffb75836781f08452232f3bf9f72a26b

Merge pull request #5 from cafuego/issue-4-deprecated-set-output

mmathiasvr committed 2 years ago

README

The README file for this repository.

Command Output

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: mathiasvr/command-output@v2.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: mathiasvr/command-output@v2.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 }}