Output the "dnscontrol" output in the Action

This commit is contained in:
Sven Luijten 2020-06-21 19:46:35 +02:00
parent fc2b491250
commit 5df73401c5
No known key found for this signature in database
GPG key ID: A411BB3A2B88947F
2 changed files with 13 additions and 1 deletions

View file

@ -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'

View file

@ -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"