Trim carriage return \r in parsed multi-line env vars and secrets#154
Open
nathaniel-cruz-aligent wants to merge 1 commit into
Open
Trim carriage return \r in parsed multi-line env vars and secrets#154nathaniel-cruz-aligent wants to merge 1 commit into
nathaniel-cruz-aligent wants to merge 1 commit into
Conversation
Comment on lines
130
to
139
| if [ -n "$EXTRA_VARS" ]; then | ||
| while IFS= read -r line; do | ||
| [ -n "$line" ] && echo "$line" >> "$GITHUB_ENV" | ||
| [ -n "$line" ] && echo "$line" | tr -d '\r' >> "$GITHUB_ENV" | ||
| done <<< "$EXTRA_VARS" | ||
| fi | ||
| if [ -n "$EXTRA_SECRETS" ]; then | ||
| while IFS= read -r line; do | ||
| [ -n "$line" ] && echo "$line" >> "$GITHUB_ENV" | ||
| [ -n "$line" ] && echo "$line" | tr -d '\r' >> "$GITHUB_ENV" | ||
| done <<< "$EXTRA_SECRETS" | ||
| fi |
Contributor
Author
There was a problem hiding this comment.
@AdamJHall can you check if this simplified version would work?
[ -n "$EXTRA_VARS" ] && echo "$EXTRA_VARS" | tr -d '\r' >> "$GITHUB_ENV"
[ -n "$EXTRA_SECRETS" ] && echo "$EXTRA_SECRETS" | tr -d '\r' >> "$GITHUB_ENV"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the proposed changes
Strip
\rcarriage return characters when exportingAIO_DEPLOY_EXTRA_VARSandAIO_DEPLOY_EXTRA_SECRETSto$GITHUB_ENV.Multi-line GitHub variables (
vars.*/secrets.*) can contain Windows-style line endings (\r\n). When these are parsed and appended to$GITHUB_ENV, the trailing\rbecomes part of the value (e.g.MY_VAR=some_value\r), causing silent failures in downstream steps that consume these environment variables.https://aligent.slack.com/archives/C093KUAK6BV/p1780440624446019?thread_ts=1780281479.709199&cid=C093KUAK6BV
Screenshots (if applicable)
Other solutions considered (if any)
Notes to PR author
Notes to reviewers
ℹ️ When you've finished leaving feedback, please add a final comment to the PR tagging the author, letting them know that you have finished leaving feedback