Skip to content

Commit 97a4d85

Browse files
committed
fix: thread scopes up to Buildbot when recording deploy env vars
1 parent 46655e4 commit 97a4d85

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/build/src/plugins/child/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type BuildEvent = 'onPreBuild' | 'onBuild' | 'onPostBuild' | 'onError' | 'onSucc
1818

1919
type RunState = Record<string, unknown>
2020

21-
type DeployEnvVarsData = { key: string; value: string; isSecret: boolean }[]
21+
type DeployEnvVarsData = { key: string; value: string; isSecret: boolean; scopes: string[] }[]
2222

2323
// Retrieve the `utils` argument.
2424
export const getUtils = function ({
@@ -72,9 +72,9 @@ const getDeployUtils = ({ deployEnvVars }: { deployEnvVars: DeployEnvVarsData })
7272

7373
const existingDeployEnvVarIdx = deployEnvVars.findIndex((env) => env.key === key)
7474
if (existingDeployEnvVarIdx !== -1) {
75-
deployEnvVars[existingDeployEnvVarIdx] = { key, value, isSecret }
75+
deployEnvVars[existingDeployEnvVarIdx] = { key, value, isSecret, scopes: Array.from(normalizedScopes) }
7676
} else {
77-
deployEnvVars.push({ key, value, isSecret })
77+
deployEnvVars.push({ key, value, isSecret, scopes: Array.from(normalizedScopes) })
7878
}
7979

8080
return env

packages/build/tests/deploy/tests.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,19 @@ test('Deploy plugin specifies deploy-specific variables in deploy event', async
147147
isSecret: false,
148148
key: 'DATABASE_URI',
149149
value: '',
150+
scopes: ['builds', 'functions', 'post_processing', 'runtime'],
150151
},
151152
{
152153
isSecret: true,
153154
key: 'DATABASE_PASSWORD',
154155
value: 'collision',
156+
scopes: ['builds', 'functions', 'runtime'],
155157
},
156158
{
157159
isSecret: false,
158160
key: 'DATABASE_MOOD',
159161
value: 'feisty',
162+
scopes: ['builds', 'functions', 'post_processing', 'runtime'],
160163
},
161164
])
162165
})

0 commit comments

Comments
 (0)