Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a085d48

Browse files
committed
Normalize line endings before base64 encoding in configure.sh for improved cross-platform compatibility
1 parent 0a420d2 commit a085d48

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎lib/actions/configure.sh‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,14 @@ gh_set_env() {
140140
local content
141141
if [ -n "$file" ]; then
142142
if [ "$base64_encode" = true ]; then
143-
content=$(base64_encode "$file")
143+
# Normalize line endings before encoding to ensure cross-platform compatibility
144+
content=$(tr -d '\r' < "$file" | base64_encode -)
144145
else
145146
content=$(<"$file")
146147
fi
147148
else
148149
if [ "$base64_encode" = true ]; then
149-
content=$(echo -n "$value" | base64_encode -)
150+
content=$(printf '%s' "$value" | base64_encode -)
150151
else
151152
content="$value"
152153
fi

0 commit comments

Comments
 (0)