From 5fc1b0e2fbe6dd3e10bb58342a65dd14a3e17282 Mon Sep 17 00:00:00 2001 From: Harm Weites Date: Thu, 31 Mar 2022 11:14:55 +0200 Subject: [PATCH] chore: escape backticks in results var --- hadolint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hadolint.sh b/hadolint.sh index e33a516..c08c64b 100755 --- a/hadolint.sh +++ b/hadolint.sh @@ -36,8 +36,6 @@ else fi FAILED=$? -echo "::set-output name=results::$RESULTS" - if [ -n "$HADOLINT_OUTPUT" ]; then if [ -f "$HADOLINT_OUTPUT" ]; then HADOLINT_OUTPUT="$TMP_FOLDER/$HADOLINT_OUTPUT" @@ -45,6 +43,9 @@ if [ -n "$HADOLINT_OUTPUT" ]; then echo "$RESULTS" > $HADOLINT_OUTPUT fi +RESULTS="${RESULTS//\`/\\\`}" +echo "::set-output name=results::$RESULTS" + [ -z "$HADOLINT_OUTPUT" ] || echo "Hadolint output saved to: $HADOLINT_OUTPUT" exit $FAILED