diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a800f8..186a1fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -445,6 +445,29 @@ jobs: MYSECRET=foo INVALID_SECRET= + secret-files: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 + with: + version: ${{ inputs.buildx-version || env.BUILDX_VERSION }} + driver-opts: | + image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }} + - + name: Build + uses: ./ + with: + context: . + file: ./test/secret.Dockerfile + secret-files: | + MYSECRET=./test/secret.txt + INVALID_SECRET= + secret-envs: runs-on: ubuntu-latest steps: diff --git a/__tests__/context.test.ts b/__tests__/context.test.ts index 25ece9a..cb3f31c 100644 --- a/__tests__/context.test.ts +++ b/__tests__/context.test.ts @@ -389,7 +389,7 @@ ccc`], 'build', '--file', './test/Dockerfile', '--iidfile', imageIDFilePath, - '--secret', `id=MY_SECRET,src=${tmpName}`, + '--secret', `id=MY_SECRET,src=${path.join(fixturesDir, 'secret.txt')}`, '--builder', 'builder-git-context-2', '--network', 'host', '--push', diff --git a/test/secret.txt b/test/secret.txt new file mode 100644 index 0000000..1910281 --- /dev/null +++ b/test/secret.txt @@ -0,0 +1 @@ +foo \ No newline at end of file