mirror of
https://github.com/koenrh/dnscontrol-action.git
synced 2025-01-19 21:49:26 +08:00
Merge pull request #26 from svenluijten/patch-1
Define an output in the action file
This commit is contained in:
commit
99141bcf26
2 changed files with 14 additions and 1 deletions
|
@ -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'
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue