File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,29 @@ jobs:
302302 run : |
303303 docker image inspect myimage:latest
304304
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+
305328 network :
306329 runs-on : ubuntu-latest
307330 steps :
Original file line number Diff line number Diff line change @@ -137,8 +137,7 @@ describe('getSecret', () => {
137137 }
138138 expect ( true ) . toBe ( ! invalid ) ;
139139 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 ) ;
142141 } catch ( err ) {
143142 // eslint-disable-next-line jest/no-conditional-expect
144143 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