ci: fix workflow_dispatch handling in build workflows, tagging, and version metadata#75
Merged
openwrt-bot merged 5 commits intoopenwrt:mainfrom Jan 12, 2026
Merged
Conversation
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>
1a56e9c to
f92acc6
Compare
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 filesfrom refs/pull/{N}/merge.
The issue was identified by inspecting the workflow run logs which showed:
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.