Skip to content

Commit 0dcf8f2

Browse files
committed
correctly detect prereleases as valid semver
1 parent 2b5e085 commit 0dcf8f2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/actions/get-image-tag/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,15 @@ runs:
6666
shell: bash
6767
env:
6868
tag: ${{ steps.get_tag.outputs.tag }}
69+
# Will match most semver formats except build metadata, i.e. v1.2.3+build.1
70+
# Valid matches:
71+
# v1.2.3
72+
# v1.2.3-alpha
73+
# v1.2.3-alpha.1
74+
# v1.2.3-rc.1
75+
# v1.2.3-beta-1
6976
run: |
70-
if [[ "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+)?$ ]]; then
77+
if [[ "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then
7178
echo "Tag is a semantic version: ${tag}"
7279
is_semver=true
7380
else

0 commit comments

Comments
 (0)