Skip to content

Commit

Permalink
[steps] [ENG-14503] Don't wrap b64-encoded values on Linux (#491)
Browse files Browse the repository at this point in the history
* [steps] Base64 encode set env vars

When using set-env command base64-encode the value of the env var before saving to a file

See: https://linear.app/expo/issue/ENG-14503/base64-encode-env-vars-in-custom-builds

* [steps] Base64 decode env vars

When collecting envs base64-decode them

See: https://linear.app/expo/issue/ENG-14503/base64-encode-env-vars-in-custom-builds

* [steps] Remove unused utils

Removed the env utils which are no longer used

See: https://linear.app/expo/issue/ENG-14503/base64-encode-env-vars-in-custom-builds

* [steps] Add encoding

Added explicit encoding when decoding from b64

See: https://linear.app/expo/issue/ENG-14503/base64-encode-env-vars-in-custom-builds

* [steps] Avoid line wraps on Linux

Linux systems add line wraps to b64 encoded values after 76 characters by default. We don't want that

See: https://linear.app/expo/issue/ENG-14503/base64-encode-env-vars-in-custom-builds

* [steps] Avoid line wraps on Linux

Linux systems add line wraps to b64 encoded values after 76 characters by default. We don't want that

See: https://linear.app/expo/issue/ENG-14503/base64-encode-env-vars-in-custom-builds
  • Loading branch information
radoslawkrzemien authored Jan 14, 2025
1 parent b221cb6 commit 3212222
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/steps/bin/set-env
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ if [[ "$NAME" == *"="* ]]; then
exit 1
fi

echo -n "$VALUE" | base64 > $__EXPO_STEPS_ENVS_DIR/$NAME
if [[ "$OSTYPE" == "linux"* ]]; then
echo -n "$VALUE" | base64 -w 0 > $__EXPO_STEPS_ENVS_DIR/$NAME
else
echo -n "$VALUE" | base64 > $__EXPO_STEPS_ENVS_DIR/$NAME
fi

0 comments on commit 3212222

Please sign in to comment.