From 3403c2e471024b132c9bfe069051437d4d2b53c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Kreienb=C3=BChl?= Date: Fri, 15 Sep 2023 16:11:31 +0200 Subject: [PATCH] workaround with forelast version HEAD --- .github/workflows/docker.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 402d99fb..993f9729 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,6 +28,7 @@ jobs: outputs: version: ${{ steps.extract-version.outputs.version }} + version-forelast: ${{ steps.extract-version-forelast.outputs.version }} branch: ${{ steps.extract-branch.outputs.branch }} steps: @@ -40,6 +41,12 @@ jobs: git fetch --prune --tags echo "version=`git tag -l --points-at=HEAD | sed -En 's/^v(.*)/\1/p'`" >> $GITHUB_OUTPUT + - name: Get version tag of HEAD~1 if any + id: extract-version-forelast + run: | + git fetch --prune --tags + echo "version-forelast=`git tag -l --points-at=HEAD~1 | sed -En 's/^v(.*)/\1/p'`" >> $GITHUB_OUTPUT + - name: Extract branch name id: extract-branch shell: bash @@ -51,7 +58,7 @@ jobs: build-and-push-image: runs-on: ubuntu-latest needs: prerequisites - if: github.event.pull_request.merged == true && needs.prerequisites.outputs.version == '' + if: github.event.pull_request.merged == true && needs.prerequisites.outputs.version == '' && needs.prerequisites.outputs.version-forelast == '' strategy: matrix: @@ -118,7 +125,7 @@ jobs: retag-and-push-image: runs-on: ubuntu-latest needs: prerequisites - if: github.event.pull_request.merged == true && needs.prerequisites.outputs.version != '' + if: github.event.pull_request.merged == true && needs.prerequisites.outputs.version-forelast != '' steps: - name: Login to Docker registry