From 14220196aa3804c234a8a4ef5c26f2e2f7774b2d Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Wed, 19 Aug 2026 09:47:06 -0400 Subject: [PATCH] Strip leading v from Docker Hub tags and in-container version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _build-variant.yml passed inputs.version straight through to both the Docker Hub tag and the CONTAINER_VERSION build-arg (baked in as MADSCIENCELAB_VERSION, shown in the container's welcome banner). release.yml/prerelease.yml pass the raw v-prefixed Git tag (e.g. v1.1.2), so images were pushed as e.g. throwtheswitch/madsciencelab:v1.1.2 instead of :1.1.2 — the v prefix is a Git tag/GitHub release convention only and was never meant to appear in Docker Hub tags or the version banner, which follow this repo's pre-existing no-v convention (e.g. 1.1.2a). Strip it once at the top of the job so both consumers stay in sync. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/_build-variant.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_build-variant.yml b/.github/workflows/_build-variant.yml index 0a6791b..3d6b462 100644 --- a/.github/workflows/_build-variant.yml +++ b/.github/workflows/_build-variant.yml @@ -82,6 +82,18 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@v4 + # Callers pass the raw Git ref/tag (e.g. `v1.1.2`, `v1.1.2a-pre.1`) + # or the literal `dev`. The leading `v` is a Git tag/GitHub release + # convention only — it must not leak into the Docker Hub tag or the + # in-container MADSCIENCELAB_VERSION banner, both of which follow + # this repo's pre-existing no-`v` version convention (e.g. `1.1.2a`). + - name: 'Compute image version (strip leading v)' + id: version + shell: bash + run: echo "value=${INPUT_VERSION#v}" >> "$GITHUB_OUTPUT" + env: + INPUT_VERSION: ${{ inputs.version }} + - name: 'Set up Ruby for generation tool' uses: ruby/setup-ruby@v1 with: @@ -102,7 +114,7 @@ jobs: - name: 'Run file generation' id: file-gen - run: bash build.sh ${{ inputs.dir_args }} --version ${{ inputs.version }} + run: bash build.sh ${{ inputs.dir_args }} --version ${{ steps.version.outputs.value }} - name: 'Set up Docker Buildx' uses: docker/setup-buildx-action@v3 @@ -139,11 +151,11 @@ jobs: context: . file: ${{ inputs.image_dir }}/docker/Dockerfile build-args: | - CONTAINER_VERSION=${{ inputs.version }} + CONTAINER_VERSION=${{ steps.version.outputs.value }} IMAGE_NAME=${{ inputs.image_name }} push: ${{ inputs.push }} tags: | - ${{ env.IMAGE_URL }}:${{ inputs.version }} + ${{ env.IMAGE_URL }}:${{ steps.version.outputs.value }} ${{ env.IMAGE_URL }}:latest # Connect Docker driver to GitHub Action cache service cache-from: type=gha