Skip to content

Commit

Permalink
Merge pull request #982 from Automattic/fix/context
Browse files Browse the repository at this point in the history
fix: determine the correct Docker socket from the context
  • Loading branch information
sjinks authored Dec 3, 2024
2 parents d0f1d99 + 95cf338 commit dc477f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/actions/build-docker-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,16 @@ runs:
echo "hash=" >> "${GITHUB_OUTPUT}"
fi
- name: Get Docker socket
id: socket
run: echo docker_socket="$(docker context ls --format json | jq -r 'select(.Current == true) | .DockerEndpoint' | sed 's!^unix://!!')" >> "${GITHUB_OUTPUT}"
shell: bash

- name: Security Scan
shell: bash
run: |
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${{ steps.socket.outputs.docker_socket }}:/var/run/docker.sock \
-v $(pwd)/.cache:/root/.cache \
-v $(pwd):/workdir \
-w /workdir \
Expand Down

0 comments on commit dc477f0

Please sign in to comment.