fix(cli): terminate github actions command files#4355
Conversation
|
|
Hi @sidsri14, 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. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughUpdated GitHub Actions environment and output writing to use a shared formatter with platform-specific line separators and trailing separators for non-empty entries. Added Vitest coverage for newline-terminated writes, empty inputs, environment restoration, and temporary-file cleanup. ✨ 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 |
Summary
Fixes #4003.
GitHub Actions command files (
GITHUB_ENVandGITHUB_OUTPUT) expect each command entry to be newline-terminated. The CLI helper previously joined entries with newlines but did not terminate the final entry, which could let a later append concatenate onto the last output value.This changes the helper to format command-file writes with a trailing platform line separator when there is at least one entry, while preserving empty writes as empty. It also adds a focused regression test for both env vars and outputs.
Validation
Passed:
pnpm --filter trigger.dev exec vitest run src/utilities/githubActions.test.tspnpm --filter trigger.dev exec vitest run src/utilities/colorMarkup.test.ts src/utilities/discoveryCheck.test.ts src/utilities/githubActions.test.tspnpm --filter trigger.dev run typecheckpnpm --filter trigger.dev run buildpnpm exec oxlint packages/cli-v3/src/utilities/githubActions.ts packages/cli-v3/src/utilities/githubActions.test.tspnpm exec oxfmt --check packages/cli-v3/src/utilities/githubActions.ts packages/cli-v3/src/utilities/githubActions.test.tsgit diff --checkAlso ran
pnpm --filter trigger.dev test -- --runafter building local workspace dependencies. It still fails on unrelated existing issues in this Windows checkout:src/mcp/smoke.test.tsandsrc/mcp/tools.test.tsare executable smoke scripts with no Vitest suites.src/commands/skills.test.tsexpects Windows backslash paths but receives normalized slash paths.src/entryPoints/managed/snapshot.test.tsincrementshandlerExecutionCountwhile the local variable is named_handlerExecutionCount.