From 5df73401c5b347a9c9f74554263309c503a67b21 Mon Sep 17 00:00:00 2001 From: Sven Luijten Date: Sun, 21 Jun 2020 19:46:35 +0200 Subject: [PATCH] Output the "dnscontrol" output in the Action --- action.yml | 3 +++ entrypoint.sh | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index c0d3759..e876cf2 100644 --- a/action.yml +++ b/action.yml @@ -9,6 +9,9 @@ inputs: args: description: DNSControl command required: true +outputs: + output: + description: The output of the dnscontrol command that was executed. runs: using: docker image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index 26a1bec..33c2715 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,4 +2,13 @@ set -eo pipefail -sh -c "dnscontrol $*" +OUTPUT=`sh -c "dnscontrol $1"` + +echo "$OUTPUT" + +# https://github.community/t/set-output-truncates-multiline-strings/16852/3 +OUTPUT="${OUTPUT//'%'/'%25'}" +OUTPUT="${OUTPUT//$'\n'/'%0A'}" +OUTPUT="${OUTPUT//$'\r'/'%0D'}" + +echo "::set-output name=output::$OUTPUT"