Skip to content

Commit 919ac7b

Browse files
committed
fix test since secrets are not written to temp path anymore
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent c850e69 commit 919ac7b

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,29 @@ jobs:
445445
MYSECRET=foo
446446
INVALID_SECRET=
447447
448+
secret-files:
449+
runs-on: ubuntu-latest
450+
steps:
451+
-
452+
name: Checkout
453+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
454+
-
455+
name: Set up Docker Buildx
456+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
457+
with:
458+
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
459+
driver-opts: |
460+
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
461+
-
462+
name: Build
463+
uses: ./
464+
with:
465+
context: .
466+
file: ./test/secret.Dockerfile
467+
secret-files: |
468+
MYSECRET=./test/secret.txt
469+
INVALID_SECRET=
470+
448471
secret-envs:
449472
runs-on: ubuntu-latest
450473
steps:

__tests__/context.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ ccc`],
389389
'build',
390390
'--file', './test/Dockerfile',
391391
'--iidfile', imageIDFilePath,
392-
'--secret', `id=MY_SECRET,src=${tmpName}`,
392+
'--secret', `id=MY_SECRET,src=${path.join(fixturesDir, 'secret.txt')}`,
393393
'--builder', 'builder-git-context-2',
394394
'--network', 'host',
395395
'--push',

test/secret.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
foo

0 commit comments

Comments
 (0)