Skip to content

Commit 4d512fb

Browse files
committed
fix: check out resolved release tag in build-test-push on dispatch
Plumb the resolved git ref from resolve-version through to the reusable _docker-pipeline workflow so workflow_dispatch republishes build from the specified tag instead of the caller's default branch HEAD.
1 parent 5c89bef commit 4d512fb

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/_docker-pipeline.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ on:
5656
type: string
5757
required: false
5858
default: "dev"
59+
ref:
60+
description: "Git ref to check out (e.g. refs/tags/v2.0.3). Empty checks out the caller's default ref — used by the publish workflow to build from the resolved release tag on workflow_dispatch."
61+
type: string
62+
required: false
63+
default: ""
5964
secrets:
6065
DOCKERHUB_USERNAME:
6166
required: false
@@ -71,6 +76,7 @@ jobs:
7176
- name: Checkout
7277
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7378
with:
79+
ref: ${{ inputs.ref }}
7480
persist-credentials: false
7581

7682
- name: 🔨 Set up Docker Buildx

.github/workflows/publish-docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
runs-on: ubuntu-latest
4444
outputs:
4545
version: ${{ steps.version.outputs.clean }}
46+
ref: ${{ steps.version.outputs.ref }}
4647
steps:
4748
- name: 🏷️ Resolve version
4849
id: version
@@ -130,6 +131,7 @@ jobs:
130131
arch_label: ${{ matrix.arch }}
131132
push: true
132133
version: ${{ needs.resolve-version.outputs.version }}
134+
ref: ${{ needs.resolve-version.outputs.ref }}
133135
secrets:
134136
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
135137
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

0 commit comments

Comments
 (0)