diff --git a/action.yml b/action.yml index 2b30ae4..b88d37a 100644 --- a/action.yml +++ b/action.yml @@ -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' \ No newline at end of file + image: 'Dockerfile' + env: + dest: ${{ inputs.redirect-to }} diff --git a/entrypoint.sh b/entrypoint.sh index 77afe3d..79da000 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -37,4 +37,12 @@ if [ ! -f "$HOME/.kube/config" ]; then fi fi -kubectl $* \ No newline at end of file +if [ -z "$dest" ]; then + kubectl $* +else + echo "$dest<> $GITHUB_ENV + kubectl $* >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + echo "::add-mask::$dest" +fi