Redirect output to variable
This commit is contained in:
parent
84d2a4c8aa
commit
a3b3f4058e
@ -8,6 +8,11 @@ inputs:
|
|||||||
args:
|
args:
|
||||||
description: 'Arguments for the CLI command'
|
description: 'Arguments for the CLI command'
|
||||||
required: false
|
required: false
|
||||||
|
redirect-to:
|
||||||
|
description: 'Variable name to redirect CLI output'
|
||||||
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
|
env:
|
||||||
|
dest: ${{ inputs.redirect-to }}
|
||||||
|
|||||||
@ -37,4 +37,12 @@ if [ ! -f "$HOME/.kube/config" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$dest" ]; then
|
||||||
kubectl $*
|
kubectl $*
|
||||||
|
else
|
||||||
|
output=$(kubectl $*)
|
||||||
|
echo "::set-output name=$dest::$output"
|
||||||
|
|
||||||
|
# debug only
|
||||||
|
#echo $output
|
||||||
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user