File tree 3 files changed +25
-11
lines changed
3 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,23 @@ jobs:
16
16
test :
17
17
runs-on : ubuntu-latest
18
18
steps :
19
- - uses : actions/checkout@v4
20
- - uses : coder/coder/.github/actions/setup-tf@main
21
- - uses : oven-sh/setup-bun@v2
19
+ - name : Check out code
20
+ uses : actions/checkout@v4
21
+ - name : Set up Terraform
22
+ uses : coder/coder/.github/actions/setup-tf@main
23
+ - name : Set up Bun
24
+ uses : oven-sh/setup-bun@v2
22
25
with :
26
+ # We're using the latest version of Bun for now, but it might be worth
27
+ # reconsidering. They've pushed breaking changes in patch releases
28
+ # that have broken our CI.
29
+ # Our PR where issues started to pop up: https://github.com/coder/modules/pull/383
30
+ # The Bun PR that broke things: https://github.com/oven-sh/bun/pull/16067
23
31
bun-version : latest
24
- - name : Setup
32
+ - name : Install dependencies
25
33
run : bun install
26
- - run : bun test
34
+ - name : Run tests
35
+ run : bun test
27
36
pretty :
28
37
runs-on : ubuntu-latest
29
38
steps :
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const removeOldContainers = async () => {
25
25
"-a" ,
26
26
"-q" ,
27
27
"--filter" ,
28
- ` label=modules-test` ,
28
+ " label=modules-test" ,
29
29
] ) ;
30
30
let containerIDsRaw = await readableStreamToText ( proc . stdout ) ;
31
31
let exitCode = await proc . exited ;
Original file line number Diff line number Diff line change @@ -194,13 +194,18 @@ export const testRequiredVariables = <TVars extends TerraformVariables>(
194
194
export const runTerraformApply = async < TVars extends TerraformVariables > (
195
195
dir : string ,
196
196
vars : Readonly < TVars > ,
197
- env ?: Record < string , string > ,
197
+ customEnv ?: Record < string , string > ,
198
198
) : Promise < TerraformState > => {
199
199
const stateFile = `${ dir } /${ crypto . randomUUID ( ) } .tfstate` ;
200
200
201
- const combinedEnv = env === undefined ? { } : { ...env } ;
202
- for ( const [ key , value ] of Object . entries ( vars ) ) {
203
- combinedEnv [ `TF_VAR_${ key } ` ] = String ( value ) ;
201
+ const childEnv : Record < string , string | undefined > = {
202
+ ...process . env ,
203
+ ...( customEnv ?? { } ) ,
204
+ } ;
205
+ for ( const [ key , value ] of Object . entries ( vars ) as [ string , JsonValue ] [ ] ) {
206
+ if ( value !== null ) {
207
+ childEnv [ `TF_VAR_${ key } ` ] = String ( value ) ;
208
+ }
204
209
}
205
210
206
211
const proc = spawn (
@@ -216,7 +221,7 @@ export const runTerraformApply = async <TVars extends TerraformVariables>(
216
221
] ,
217
222
{
218
223
cwd : dir ,
219
- env : combinedEnv ,
224
+ env : childEnv ,
220
225
stderr : "pipe" ,
221
226
stdout : "pipe" ,
222
227
} ,
You can’t perform that action at this time.
0 commit comments