Skip to content

Commit

Permalink
feat: redirect output to the variable (#14)
Browse files Browse the repository at this point in the history
Redirect output to the variable
  • Loading branch information
exelban authored Nov 3, 2022
2 parents 84d2a4c + 977919c commit 79f1b80
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ inputs:
args:
description: 'Arguments for the CLI command'
required: false
redirect-to:
description: 'Variable name to redirect CLI output'
required: false
runs:
using: 'docker'
image: 'Dockerfile'
image: 'Dockerfile'
env:
dest: ${{ inputs.redirect-to }}
10 changes: 9 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,12 @@ if [ ! -f "$HOME/.kube/config" ]; then
fi
fi

kubectl $*
if [ -z "$dest" ]; then
kubectl $*
else
echo "$dest<<EOF" >> $GITHUB_ENV
kubectl $* >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

echo "::add-mask::$dest"
fi

0 comments on commit 79f1b80

Please sign in to comment.