[buildbot] ci: fix workflow_dispatch on PRs by using local context for docker buildx
LEDE Commits
lede-commits at lists.infradead.org
Mon Jan 12 11:23:50 PST 2026
ynezz pushed a commit to buildbot.git, branch main:
https://git.openwrt.org/f92acc64dc01107a72505c2e6a9a8104f36baeca
commit f92acc64dc01107a72505c2e6a9a8104f36baeca
Author: Petr Štetiar <ynezz at true.cz>
AuthorDate: Sun Jan 11 22:51:05 2026 +0100
ci: fix workflow_dispatch on PRs by using local context for docker buildx
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 <ynezz at true.cz>
---
.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 at 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 at v6
with:
+ context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
More information about the lede-commits
mailing list