Skip to content

Commit 8a45e02

Browse files
Fix broken multiline strings from dee0c94 (#1390)
1. Escaping behavior changed as a result of set-output deprecation. - Otherwise you'll encounter breaking changes for example "appVersion: "1.0.0"%0Aapplica..." where %0A is escaped newline \n but shouldn't be escaped. 2. Delimeter is required for multiline strings. - See here: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings - Delimeter must be random. UUID is a solid choice. I verified that /proc/sys/kernel/random/uuid does indeed exist on the yq image.
1 parent 28a6c9c commit 8a45e02

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

github-action/entrypoint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
set -e
33
echo "::debug::\$cmd: $1"
44
RESULT=$(eval "$1")
5-
RESULT="${RESULT//'%'/'%25'}"
6-
RESULT="${RESULT//$'\n'/'%0A'}"
7-
RESULT="${RESULT//$'\r'/'%0D'}"
85
echo "::debug::\$RESULT: $RESULT"
96
# updating from
7+
# https://github.com/orgs/community/discussions/26288#discussioncomment-3876281
108
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
11-
echo "result=$RESULT" >> $GITHUB_OUTPUT
9+
delimiter=$(cat /proc/sys/kernel/random/uuid)
10+
echo "result<<${delimiter}" >> "${GITHUB_OUTPUT}"
11+
echo "${RESULT}" >> "${GITHUB_OUTPUT}"
12+
echo "${delimiter}" >> "${GITHUB_OUTPUT}"

0 commit comments

Comments
 (0)