Skip to content

Commit

Permalink
workaround with forelast version HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
kaeptnegli committed Sep 15, 2023
1 parent 1e621e7 commit 3403c2e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3403c2e

Please sign in to comment.