ci: fix workflow_dispatch on PRs by using local context for docker buildx
authorPetr Štetiar <ynezz@true.cz>
Sun, 11 Jan 2026 21:51:05 +0000 (22:51 +0100)
committerPetr Štetiar <ynezz@true.cz>
Sun, 11 Jan 2026 21:56:56 +0000 (21:56 +0000)
commitf92acc64dc01107a72505c2e6a9a8104f36baeca
treebe1df0dd3b2c60735bc7d1e88f12b06be2328695
parent9470e52e6c181f223cd263bd3581d294ab4b2c35
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@true.cz>
.github/workflows/build-push.yml