Merge pull request #26 from svenluijten/patch-1

Define an output in the action file
This commit is contained in:
Koen Rouwhorst 2020-07-22 09:54:01 +02:00 committed by GitHub
commit 99141bcf26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 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,14 @@
set -eo pipefail
sh -c "dnscontrol $*"
IFS=
OUTPUT="$(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"