From b72f46f10816c31111a41ab0b0d57a993bb48132 Mon Sep 17 00:00:00 2001 From: Jon Fuller Date: Mon, 14 Oct 2024 14:06:55 -0700 Subject: [PATCH] Don't add `stable` if pushed tag has `-` --- .github/workflows/main-docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main-docker.yml b/.github/workflows/main-docker.yml index a3f569ff2..a9b752167 100644 --- a/.github/workflows/main-docker.yml +++ b/.github/workflows/main-docker.yml @@ -244,7 +244,8 @@ jobs: $(printf '${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *) # If the ref is a tag, also tag the image as stable as this is part of a 'release' - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + # and only go in the `if` if there is NOT a `-` in the tag's name, due to tagging of `-alpha`, `-beta`, etc... + if [[ "${GITHUB_REF}" == refs/tags/* && ! "${REF_NAME}" =~ - ]]; then docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ -t ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:stable \ $(printf '${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)