From 8f0a0381d330c856d2630f0a95123d3fe752e3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20S=C3=A1nchez?= Date: Sat, 24 Oct 2020 11:30:51 +0200 Subject: [PATCH] Get tag when it's a version release --- .github/workflows/docker.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3e7d3e9..64c0cc1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,10 +15,16 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - + - name: Extract branch name shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + run: | + tag=${GITHUB_REF#refs/tags/} + tag=${tag#refs/heads/} + if echo $tag | grep -q -E "[0-9]+\.[0-9]+\.[0-9]+"; then + tag="v$tag" + fi + echo "##[set-output name=tag;]$tag" id: extract_branch - name: Login to DockerHub