Title: `trigger deploy`: wrong git metadata and build context from a git worktree · Issue #5103 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: `trigger deploy`: wrong git metadata and build context from a git worktree · Issue #5103 · triggerdotdev/trigger.dev
X Title: `trigger deploy`: wrong git metadata and build context from a git worktree · Issue #5103 · triggerdotdev/trigger.dev
Description: Version: trigger.dev CLI 4.7.7, local deploys (not GitHub Actions or the GitHub App). config.workspaceDir comes from pkg-types findWorkspaceDir, which looks for the nearest .git/config file. A linked worktree has a .git file, not a direc...
Open Graph Description: Version: trigger.dev CLI 4.7.7, local deploys (not GitHub Actions or the GitHub App). config.workspaceDir comes from pkg-types findWorkspaceDir, which looks for the nearest .git/config file. A link...
X Description: Version: trigger.dev CLI 4.7.7, local deploys (not GitHub Actions or the GitHub App). config.workspaceDir comes from pkg-types findWorkspaceDir, which looks for the nearest .git/config file. A link...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/5103
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`trigger deploy`: wrong git metadata and build context from a git worktree","articleBody":"**Version:** trigger.dev CLI 4.7.7, local deploys (not GitHub Actions or the GitHub App).\n\n`config.workspaceDir` comes from pkg-types `findWorkspaceDir`, which looks for the nearest `.git/config` *file*. A linked worktree has a `.git` file, not a directory, so the lookup misses it. Two things then go wrong.\n\n**1. A worktree nested inside another checkout** (for example `repo/.worktrees/release`): `workspaceDir` resolves to the outer checkout.\n- `createGitMeta` runs `git log` and `git status` there, so the deployment records the outer checkout's commit, branch, and dirty flag. We saw a deploy built from a clean worktree at `ae22adff` recorded as `23422c6f`, `main`, dirty.\n- On the native build path, `createContextArchive(config.workspaceDir, …)` tars the outer checkout, not the worktree being deployed.\n\n**2. A worktree outside any checkout:** `workspaceDir` is the worktree itself, which is correct. But `getOriginUrl(join(directory, \".git/config\"))` reads that path as a file, and in a worktree it doesn't exist. So `remoteUrl` is always missing. `GIT_DIR` and `GIT_WORK_TREE` don't help, because this value never goes through git.\n\n**Suggested fix:** take both values from git in the project directory: `git rev-parse --show-toplevel` for the workspace, and `git config --get remote.origin.url` for the remote. That handles worktrees and respects `GIT_DIR`. Today we work around the first problem by exporting `GIT_DIR` and `GIT_WORK_TREE` and refusing nested-worktree deploys. The second has no workaround short of faking a `.git/config`.\n","author":{"url":"https://github.com/bonesasit","@type":"Person","name":"bonesasit"},"datePublished":"2026-11-06T21:27:24Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/5103"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:224d707e-38b5-999e-5139-fc1ad520be6e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5E4:2B9252:115D01F:185BA92:6AFAD856 |
| html-safe-nonce | 4e710a9523812732da6aa80d335c44e1524ef9643edd7326ffbe7d90130f9068 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUU0OjJCOTI1MjoxMTVEMDFGOjE4NUJBOTI6NkFGQUQ4NTYiLCJ2aXNpdG9yX2lkIjoiNDU5ODQ5Njc5ODQyNjQ1NDEwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0e39909a22051a567c479011a8a4366ae7028acf9829f0e8b077aca7f3766e2c |
| hovercard-subject-tag | issue:6250956085 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/trigger.dev/5103/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5858ffb89cc7d34c89beafa2421d678a37b4f434f0b2071c1018d7cf50795270/triggerdotdev/trigger.dev/issues/5103 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5858ffb89cc7d34c89beafa2421d678a37b4f434f0b2071c1018d7cf50795270/triggerdotdev/trigger.dev/issues/5103 |
| og:image:alt | Version: trigger.dev CLI 4.7.7, local deploys (not GitHub Actions or the GitHub App). config.workspaceDir comes from pkg-types findWorkspaceDir, which looks for the nearest .git/config file. A link... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bonesasit |
| hostname | github.com |
| expected-hostname | github.com |
| None | 02f4c00e74911c7cd779fc232c3130cee49eb39fd0ed4bfe3eea3b82c7c18084 |
| turbo-cache-control | no-preview |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 33c41e9d150e44415272934d676dc63c57d89c3b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width