diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index dd69649..7346ae6 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -28,14 +28,6 @@ jobs: VERSION="${VERSION//v}" TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}" - # If the VERSION looks like a version number, assume that - # this is the most recent version of the image and also - # tag it 'latest'. - if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then - TAGS="$TAGS,${DOCKER_IMAGE}:latest" - fi - - # Set output parameters. echo ::set-output name=tags::${TAGS} echo ::set-output name=docker_image::${DOCKER_IMAGE} diff --git a/.github/workflows/docker-multiplatform.yml b/.github/workflows/docker-multiplatform.yml index 3ecfb12..32ee5fd 100644 --- a/.github/workflows/docker-multiplatform.yml +++ b/.github/workflows/docker-multiplatform.yml @@ -18,12 +18,10 @@ jobs: run: | DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/} VERSION=latest - SHORTREF=${GITHUB_SHA::8} + SHORTREF=$(git rev-parse --short=8 ${{ inputs.tag }}) - # If this is git tag, use the tag name as a docker tag - if [[ $GITHUB_REF == refs/tags/* ]]; then - VERSION=${GITHUB_REF#refs/tags/v} - fi + VERSION=${{ inputs.tag }} + VERSION="${VERSION//v}" TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}" # If the VERSION looks like a version number, assume that @@ -33,6 +31,7 @@ jobs: TAGS="$TAGS,${DOCKER_IMAGE}:latest" fi + # Set output parameters. echo ::set-output name=tags::${TAGS} echo ::set-output name=docker_image::${DOCKER_IMAGE}