Skip to content

fix(secret/set): strip trailing CR from env-file secrets on Windows#13673

Open
jfjrh2014 wants to merge 1 commit into
cli:trunkfrom
jfjrh2014:fix/secret-env-file-crlf
Open

fix(secret/set): strip trailing CR from env-file secrets on Windows#13673
jfjrh2014 wants to merge 1 commit into
cli:trunkfrom
jfjrh2014:fix/secret-env-file-crlf

Conversation

@jfjrh2014

Copy link
Copy Markdown

CRLF line endings cause a trailing carriage return to be included in secret values parsed from --env-file on Windows. The stdin path already strips this with bytes.TrimRight in getBody, but the env-file path skips it.

This applies bytes.TrimRight to each secret value after godotenv.Parse, matching the existing pattern.

Fixes #13588

CRLF line endings cause a trailing carriage return to be included in
secret values parsed from --env-file on Windows. The stdin path already
strips this with bytes.TrimRight on body, but the env-file path skips
it.

Fixes cli#13588
@jfjrh2014 jfjrh2014 requested a review from a team as a code owner June 16, 2026 11:19
@jfjrh2014 jfjrh2014 requested a review from BagToad June 16, 2026 11:19
@github-actions

Copy link
Copy Markdown

Thanks for your pull request! While it doesn't meet all of our standard requirements, it appears to be a small, focused contribution and has been routed to the team for review.

Note: We still encourage linking to an issue with the help wanted label when possible, as it helps us prioritize and track contributions.

@github-actions github-actions Bot added external pull request originating outside of the CLI core team needs-triage needs to be reviewed labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team needs-triage needs to be reviewed ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trailing whitespace in secret value when using gh secret set

1 participant