Skip to content

fix(cli): terminate github actions command files#4355

Closed
sidsri14 wants to merge 1 commit into
triggerdotdev:mainfrom
sidsri14:fix-github-actions-command-file-newlines
Closed

fix(cli): terminate github actions command files#4355
sidsri14 wants to merge 1 commit into
triggerdotdev:mainfrom
sidsri14:fix-github-actions-command-file-newlines

Conversation

@sidsri14

Copy link
Copy Markdown

Summary

Fixes #4003.

GitHub Actions command files (GITHUB_ENV and GITHUB_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.ts
  • pnpm --filter trigger.dev exec vitest run src/utilities/colorMarkup.test.ts src/utilities/discoveryCheck.test.ts src/utilities/githubActions.test.ts
  • pnpm --filter trigger.dev run typecheck
  • pnpm --filter trigger.dev run build
  • pnpm exec oxlint packages/cli-v3/src/utilities/githubActions.ts packages/cli-v3/src/utilities/githubActions.test.ts
  • pnpm exec oxfmt --check packages/cli-v3/src/utilities/githubActions.ts packages/cli-v3/src/utilities/githubActions.test.ts
  • git diff --check

Also ran pnpm --filter trigger.dev test -- --run after building local workspace dependencies. It still fails on unrelated existing issues in this Windows checkout:

  • src/mcp/smoke.test.ts and src/mcp/tools.test.ts are executable smoke scripts with no Vitest suites.
  • src/commands/skills.test.ts expects Windows backslash paths but receives normalized slash paths.
  • src/entryPoints/managed/snapshot.test.ts increments handlerExecutionCount while the local variable is named _handlerExecutionCount.

@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e598c5d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot closed this Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5728ee4d-8858-4d81-86fb-f2f47a0b57cc

📥 Commits

Reviewing files that changed from the base of the PR and between 88ca009 and e598c5d.

📒 Files selected for processing (2)
  • packages/cli-v3/src/utilities/githubActions.test.ts
  • packages/cli-v3/src/utilities/githubActions.ts

Walkthrough

Updated 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)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setGithubActionsOutputAndEnvVars writes GITHUB_ENV/GITHUB_OUTPUT entries without a trailing newline

1 participant