Skip to content

Conversation

@ynezz
Copy link
Member

@ynezz ynezz commented Jan 11, 2026

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 }}

ci: avoid branch tags on workflow_dispatch

Currently workflow_dispatch pushes branch tags, so lets fix it by
disabling branch tagging for dispatch runs.

ci: rename OPENWRT_VERSION to BUILDBOT_CONFIG_SHA

The old name was misleading as it suggested an OpenWrt release version.
The variable holds the git SHA of this buildbot config repository, used
for quick URL links to the configuration commit.

ci: add container version tag to BUILDWORKER_DESCRIPTION

Add CONTAINER_TAG build argument to indicate whether the container
was built from a tag (v25), PR (pr-73), or branch (main). This makes
it easier to identify which version of the container is running.

While at it, drop Docker prefix to make it shorter.

ci: centralize BUILDBOT_VERSION in a shared file

Move the buildbot version from duplicate workflow env blocks to a single
.github/buildbot-version file.

ynezz added 5 commits January 11, 2026 20:52
Move the buildbot version from duplicate workflow env blocks to a single
.github/buildbot-version file.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Add CONTAINER_TAG build argument to indicate whether the container
was built from a tag (v25), PR (pr-73), or branch (main). This makes
it easier to identify which version of the container is running.

While at it, drop Docker prefix to make it shorter.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
The old name was misleading as it suggested an OpenWrt release version.
The variable holds the git SHA of this buildbot config repository, used
for quick URL links to the configuration commit.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Currently workflow_dispatch pushes branch tags, so lets fix it by
disabling branch tagging for dispatch runs.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
…ildx

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>
@ynezz ynezz force-pushed the ynezz/ci-moore-improvements branch from 1a56e9c to f92acc6 Compare January 11, 2026 21:58
@ynezz ynezz requested a review from Copilot January 12, 2026 05:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@openwrt-bot openwrt-bot merged commit f92acc6 into openwrt:main Jan 12, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants