Redirect output to variable
This commit is contained in:
parent
84d2a4c8aa
commit
a3b3f4058e
@ -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
|
||||
|
||||
if [ -z "$dest" ]; then
|
||||
kubectl $*
|
||||
else
|
||||
output=$(kubectl $*)
|
||||
echo "::set-output name=$dest::$output"
|
||||
|
||||
# debug only
|
||||
#echo $output
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user