From f92acc64dc01107a72505c2e6a9a8104f36baeca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20=C5=A0tetiar?= Date: Sun, 11 Jan 2026 22:51:05 +0100 Subject: [PATCH] ci: fix workflow_dispatch on PRs by using local context for docker buildx MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Without explicit context, docker/build-push-action defaults to fetching from the GitHub repository using github.sha as the ref. For workflow_dispatch events, github.sha points to the default branch (main), not the checked-out PR ref. This caused PR container builds to contain main branch code instead of the PR changes. With `context: .` makes Docker build uses the locally checked-out files from refs/pull/{N}/merge. The issue was identified by inspecting the workflow run logs which showed: docker buildx build ... https://github.com/openwrt/buildbot.git#93918cc2e2257ae8838166d2baad30617295df4e The #93918cc2... ref at the end is the main branch SHA, not the PR merge commit. This is the default behavior when context is not specified - the action uses ${{ github.server_url }}/${{ github.repository }}.git#${{ github.sha }} Signed-off-by: Petr Å tetiar --- .github/workflows/build-push.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 63f666a..c9f07c6 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -89,6 +89,7 @@ jobs: - name: Build container and export it to local Docker uses: docker/build-push-action@v6 with: + context: . load: true tags: local/${{ matrix.container_flavor }} file: docker/build${{ matrix.container_flavor }}/Dockerfile @@ -160,6 +161,7 @@ jobs: - name: Build container again and push it uses: docker/build-push-action@v6 with: + context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} -- 2.30.2