From a48c81fe8fc5301600e281ee667092d2dddec48f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 15 Oct 2023 22:54:24 -0400 Subject: [PATCH] fix: check if ref_name is a tag for detecting the image_tag --- .github/workflows/docker-push.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 0c863f2..96baeba 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -8,7 +8,7 @@ on: types: - completed push: - tags: + tags: - '*' concurrency: @@ -35,6 +35,10 @@ jobs: elif [[ '${{ github.event.workflow_run.head_branch }}' == "master" ]]; then echo -e "\u001b[32mDetected master branch\u001b[0m" push_enabled=true + elif [[ '${{github.ref_name}}' =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo -e "\u001b[32mDetected semver tag\u001b[0m" + image_tag='${{ github.ref_name }}' + push_enabled=true else echo "::warning ::Unable to detect semver tag or master branch" push_enabled=false