diff --git a/action.yml b/action.yml index 405b14a..6b55ee0 100644 --- a/action.yml +++ b/action.yml @@ -67,6 +67,11 @@ inputs: description: 'Enable debug mode.' allenvs: description: 'pass all environment variable to shell script.' +outputs: + stdout: + description: 'Standard output of the executed commands.' + stderr: + description: 'Standard error of the executed commands.' runs: using: 'docker' image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index f880594..584336a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,4 +4,11 @@ set -eu export GITHUB="true" -sh -c "/bin/drone-ssh $*" +{ + sh -c "/bin/drone-ssh $*" +} 2> /tmp/errFile | tee /tmp/outFile + +stdout=$(cat /tmp/outFile) +stderr=$(cat /tmp/errFile) +echo "stdout=${stdout//$'\n'/\\n}" >> $GITHUB_OUTPUT +echo "stderr=${stderr//$'\n'/\\n}" >> $GITHUB_OUTPUT