Skip to content

Commit 126c4bd

Browse files
committed
Strip out TRIGGER\_ keys when using syncEnvVars, to prevent deploy errors
1 parent c0785ee commit 126c4bd

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.changeset/twelve-onions-decide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/build": patch
3+
---
4+
5+
Strip out TRIGGER\_ keys when using syncEnvVars, to prevent deploy errors

packages/build/src/extensions/core/syncEnvVars.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ const UNSYNCABLE_ENV_VARS = [
6363
"_",
6464
];
6565

66+
const UNSYNCABLE_ENV_VARS_PREFIXES = ["TRIGGER_"];
67+
6668
export type SyncEnvVarsFunction = (params: SyncEnvVarsParams) => SyncEnvVarsResult;
6769

6870
export type SyncEnvVarsOptions = {
@@ -98,6 +100,11 @@ export function syncEnvVars(fn: SyncEnvVarsFunction, options?: SyncEnvVarsOption
98100
return acc;
99101
}
100102

103+
// Strip out any TRIGGER_ prefix env vars
104+
if (UNSYNCABLE_ENV_VARS_PREFIXES.some((prefix) => key.startsWith(prefix))) {
105+
return acc;
106+
}
107+
101108
acc[key] = value;
102109
return acc;
103110
},

0 commit comments

Comments
 (0)