Skip to content

fix(build): strip leading .. from additionalFiles paths on Windows - #5075

Closed
SimoMay wants to merge 1 commit into
triggerdotdev:mainfrom
SimoMay:fix/additional-files-windows-paths
Closed

SimoMay wants to merge 1 commit into
triggerdotdev:mainfrom
SimoMay:fix/additional-files-windows-paths

Conversation

@SimoMay

@SimoMay SimoMay commented Oct 26, 2026

Copy link
Copy Markdown

Fixes #5074

What

findFilesByMatchers (packages/build/src/internal/copyFiles.ts) splits the output of relative() on / to drop leading .. segments. On Windows relative() returns backslash paths, so nothing is dropped and additionalFiles matches like ../shared/** are copied outside the build directory. This splits on the platform separator (sep) instead and still joins with /.

Verification

  • Windows logic, via path.win32: C:\repo\app + C:\repo\shared\a.md now resolves to <build>\shared\a.md. Before the change it resolved to C:\repo\app\.trigger\tmp\shared\a.md.
  • macOS: ran the patched findFilesByMatchers against real files with ../shared/**. It returns <build>/shared/sub/a.md, the same as before.

I didn't add a unit test: the function uses the native path module, so a Windows test needs a Windows CI runner or the path functions passed in. Happy to add either if you prefer.

Changeset: @trigger.dev/build patch.

🤖 Generated with Claude Code

findFilesByMatchers split relative() output on "/", but on Windows
relative() returns backslash paths, so no ".." segment was removed and
matched files were copied outside the build directory. Split on the
platform separator instead.

Fixes triggerdotdev#5074

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@changeset-bot

changeset-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c6beede

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

This PR includes changesets to release 30 packages
Name Type
@trigger.dev/build Patch
trigger.dev Patch
@trigger.dev/python Patch
@internal/dashboard-agent Patch
@trigger.dev/core Patch
@trigger.dev/linear Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/slack Patch
@trigger.dev/sdk Patch
@trigger.dev/billing 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 @SimoMay, 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 Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@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

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.

bug: additionalFiles copies ../ matches outside the build on Windows

1 participant