Skip to content

Commit c79c516

Browse files
author
Raffael Herrmann
committed
Update workflow: remove branch default, detect only version tags
1 parent fb2808b commit c79c516

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
branch:
77
description: 'Branch to build from'
88
required: true
9-
default: 'release-v1'
109
type: string
1110
tag_as_latest:
1211
description: 'Tag image as latest'
@@ -24,13 +23,13 @@ jobs:
2423
with:
2524
ref: ${{ inputs.branch }}
2625

27-
- name: Get latest tag
26+
- name: Get latest version tag
2827
id: get-tag
2928
run: |
3029
git fetch --tags
31-
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
30+
LATEST_TAG=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-version:refname | head -1)
3231
if [ -z "$LATEST_TAG" ]; then
33-
echo "No tags found on branch ${{ inputs.branch }}"
32+
echo "No version tags found on branch ${{ inputs.branch }}"
3433
exit 1
3534
fi
3635
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)