mirror of
https://github.com/koenrh/dnscontrol-action.git
synced 2024-11-10 17:13:59 +08:00
22 lines
555 B
Bash
Executable file
22 lines
555 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eo pipefail
|
|
|
|
# Resolve to full paths
|
|
CONFIG_ABS_PATH="$(readlink -f "${INPUT_CONFIG_FILE}")"
|
|
CREDS_ABS_PATH="$(readlink -f "${INPUT_CREDS_FILE}")"
|
|
|
|
WORKING_DIR="$(dirname "${CONFIG_ABS_PATH}")"
|
|
cd "$WORKING_DIR"
|
|
|
|
IFS=
|
|
OUTPUT="$(dnscontrol "$1" --config "$CONFIG_ABS_PATH" --creds "$CREDS_ABS_PATH")"
|
|
|
|
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"
|