Merge pull request #83 from georgejipa/main

Fix `set-output` warning
This commit is contained in:
Koen Rouwhorst 2022-12-09 16:26:35 +01:00 committed by GitHub
commit 879b1fc55b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,17 +2,6 @@
set -o pipefail set -o pipefail
escape() {
local input="$1"
# https://github.community/t/set-output-truncates-multiline-strings/16852/3
input="${input//'%'/'%25'}"
input="${input//$'\n'/'%0A'}"
input="${input//$'\r'/'%0D'}"
echo "$input"
}
# Resolve to full paths # Resolve to full paths
CONFIG_ABS_PATH="$(readlink -f "${INPUT_CONFIG_FILE}")" CONFIG_ABS_PATH="$(readlink -f "${INPUT_CONFIG_FILE}")"
CREDS_ABS_PATH="$(readlink -f "${INPUT_CREDS_FILE}")" CREDS_ABS_PATH="$(readlink -f "${INPUT_CREDS_FILE}")"
@ -39,10 +28,16 @@ echo "$OUTPUT"
# Filter output to reduce 'preview' PR comment length # Filter output to reduce 'preview' PR comment length
FILTERED_OUTPUT="$(echo "$OUTPUT" | /filter-preview-output.sh)" FILTERED_OUTPUT="$(echo "$OUTPUT" | /filter-preview-output.sh)"
OUTPUT="$(escape "$OUTPUT")" # Set output
FILTERED_OUTPUT="$(escape "$FILTERED_OUTPUT")" # https://github.com/orgs/community/discussions/26288#discussioncomment-3876281
DELIMITER="DNSCONTROL-$RANDOM"
echo "::set-output name=output::$OUTPUT" echo "output<<$DELIMITER" >> $GITHUB_OUTPUT
echo "::set-output name=preview_comment::$FILTERED_OUTPUT" echo "$OUTPUT" >> $GITHUB_OUTPUT
echo "$DELIMITER" >> $GITHUB_OUTPUT
echo "preview_comment<<$DELIMITER" >> $GITHUB_OUTPUT
echo "$FILTERED_OUTPUT" >> $GITHUB_OUTPUT
echo "$DELIMITER" >> $GITHUB_OUTPUT
exit $EXIT_CODE exit $EXIT_CODE