fix(cli): ensure trailing newline in GitHub Actions outputs and env vars (#4003) - #4964
kaiizer777 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: d2a0dcf The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Hi @kaiizer777, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Resolves #4003
In
packages/cli-v3/src/utilities/githubActions.ts,setGithubActionsOutputAndEnvVarswrites key-value pairs toprocess.env.GITHUB_ENVandprocess.env.GITHUB_OUTPUTusing.join("\n"). Because.join("\n")does not append a trailing newline to the block, subsequent appends to$GITHUB_ENVor$GITHUB_OUTPUTin downstream GitHub Actions steps concatenate directly onto the last key-value pair, corrupting values (e.g.needsPromotion=falsetrue) and breaking step conditions.Changes
setGithubActionsOutputAndEnvVarsto ensure that when entries are present, they are terminated with a trailing newline (\n).packages/cli-v3/src/utilities/githubActions.test.tsverifying single and sequential writes, empty records, and absent environment variables.trigger.dev.Note
A vouch request is already open at #4963.