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