feat: redirect output to the variable (#14)
Redirect output to the variable
This commit is contained in:
commit
79f1b8008a
@ -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'
|
||||
env:
|
||||
dest: ${{ inputs.redirect-to }}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user