From 269c88eb12b02825553566127bc8a27ac2625981 Mon Sep 17 00:00:00 2001 From: George Jipa Date: Wed, 26 Oct 2022 04:10:37 +0300 Subject: [PATCH] fix `set-output` warning --- entrypoint.sh | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 7669ce6..ec406af 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,17 +2,6 @@ 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 CONFIG_ABS_PATH="$(readlink -f "${INPUT_CONFIG_FILE}")" CREDS_ABS_PATH="$(readlink -f "${INPUT_CREDS_FILE}")" @@ -39,10 +28,16 @@ echo "$OUTPUT" # Filter output to reduce 'preview' PR comment length FILTERED_OUTPUT="$(echo "$OUTPUT" | /filter-preview-output.sh)" -OUTPUT="$(escape "$OUTPUT")" -FILTERED_OUTPUT="$(escape "$FILTERED_OUTPUT")" +# Set output +# https://github.com/orgs/community/discussions/26288#discussioncomment-3876281 +DELIMITER="DNSCONTROL-$RANDOM" -echo "::set-output name=output::$OUTPUT" -echo "::set-output name=preview_comment::$FILTERED_OUTPUT" +echo "output<<$DELIMITER" >> $GITHUB_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