File tree 3 files changed +28
-2
lines changed
3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,29 @@ jobs:
302
302
run : |
303
303
docker image inspect myimage:latest
304
304
305
+ secret :
306
+ runs-on : ubuntu-latest
307
+ steps :
308
+ -
309
+ name : Checkout
310
+ uses : actions/checkout@v3
311
+ -
312
+ name : Set up Docker Buildx
313
+ uses : docker/setup-buildx-action@v2
314
+ with :
315
+ version : ${{ inputs.buildx-version || env.BUILDX_VERSION }}
316
+ driver-opts : |
317
+ image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
318
+ -
319
+ name : Build
320
+ uses : ./
321
+ with :
322
+ context : .
323
+ file : ./test/secret.Dockerfile
324
+ secrets : |
325
+ MYSECRET=foo
326
+ INVALID_SECRET=
327
+
305
328
network :
306
329
runs-on : ubuntu-latest
307
330
steps :
Original file line number Diff line number Diff line change @@ -137,8 +137,7 @@ describe('getSecret', () => {
137
137
}
138
138
expect ( true ) . toBe ( ! invalid ) ;
139
139
expect ( secret ) . toEqual ( `id=${ exKey } ,src=${ tmpNameSync } ` ) ;
140
- const secretValue = await fs . readFileSync ( tmpNameSync , 'utf-8' ) ;
141
- expect ( secretValue ) . toEqual ( exValue ) ;
140
+ expect ( fs . readFileSync ( tmpNameSync , 'utf-8' ) ) . toEqual ( exValue ) ;
142
141
} catch ( err ) {
143
142
// eslint-disable-next-line jest/no-conditional-expect
144
143
expect ( true ) . toBe ( invalid ) ;
Original file line number Diff line number Diff line change
1
+ # syntax=docker/dockerfile:1
2
+ FROM busybox
3
+ RUN --mount=type=secret,id=MYSECRET \
4
+ echo "MYSECRET=$(cat /run/secrets/MYSECRET)"
You can’t perform that action at this time.
0 commit comments