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"