Skip to content

fix(cli): ensure trailing newline in GitHub Actions outputs and env vars (#4003) - #4964

Closed
kaiizer777 wants to merge 1 commit into
triggerdotdev:mainfrom
kaiizer777:fix/github-actions-output-newline
Closed

kaiizer777 wants to merge 1 commit into
triggerdotdev:mainfrom
kaiizer777:fix/github-actions-output-newline

Conversation

@kaiizer777

Copy link
Copy Markdown

Description

Resolves #4003

In packages/cli-v3/src/utilities/githubActions.ts, setGithubActionsOutputAndEnvVars writes key-value pairs to process.env.GITHUB_ENV and process.env.GITHUB_OUTPUT using .join("\n"). Because .join("\n") does not append a trailing newline to the block, subsequent appends to $GITHUB_ENV or $GITHUB_OUTPUT in downstream GitHub Actions steps concatenate directly onto the last key-value pair, corrupting values (e.g. needsPromotion=falsetrue) and breaking step conditions.

Changes

  • Updated setGithubActionsOutputAndEnvVars to ensure that when entries are present, they are terminated with a trailing newline (\n).
  • Guarded against appending unnecessary newlines when entry records are empty.
  • Added unit tests in packages/cli-v3/src/utilities/githubActions.test.ts verifying single and sequential writes, empty records, and absent environment variables.
  • Added a patch changeset for trigger.dev.

Note

A vouch request is already open at #4963.

@changeset-bot

changeset-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d2a0dcf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
trigger.dev Patch
@internal/dashboard-agent Patch
@trigger.dev/build Patch
@trigger.dev/core Patch
@trigger.dev/python Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch
@trigger.dev/rbac Patch
@trigger.dev/sso Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@internal/metrics-pipeline Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/run-store Patch
@internal/schedule-engine Patch
@internal/tracing Patch
@internal/webhook-engine Patch
@internal/webhook-sources Patch
@internal/testcontainers Patch
@internal/cache Patch

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

@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot closed this Sep 20, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 7af1a642-c82e-43c1-9b30-b7bde9c006db

📥 Commits

Reviewing files that changed from the base of the PR and between 414e5a2 and d2a0dcf.

📒 Files selected for processing (3)
  • .changeset/github-actions-output-newline.md
  • packages/cli-v3/src/utilities/githubActions.test.ts
  • packages/cli-v3/src/utilities/githubActions.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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