Skip to content

Commit 7270bde

Browse files
committed
fix(ci): build the Docker preview from the checked-out workspace
The publish-docker job downloads the built wheel to ./dist, but the build step omitted `context`, so docker/build-push-action used its default Git context. Buildx then cloned the repository as the build context, where ./dist does not exist, and `COPY dist/socketsecurity-*.whl` failed with "lstat /dist: no such file or directory". Set `context: .` so the build uses the workspace the artifact was downloaded into. This also makes the job's existing trust boundary hold as documented: the context is now the default-branch checkout rather than the pull-request ref, so Dockerfile.preview is read from trusted code and the pull request still enters the image only through the built wheel. Pre-existing; the TestPyPI half of the workflow is unaffected.
1 parent 85ea858 commit 7270bde

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/pr-preview.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ jobs:
261261
- name: Build and push Docker preview
262262
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
263263
with:
264+
# Build from the checked-out workspace, not the default Git context. The
265+
# wheel is only present here as a downloaded artifact, and this also keeps
266+
# Dockerfile.preview on the default-branch checkout rather than the PR ref.
267+
context: .
264268
file: Dockerfile.preview
265269
push: true
266270
pull: true

0 commit comments

Comments
 (0)