From 63762b7a27b2bb72a2717fa6ac1efae6cc002bc8 Mon Sep 17 00:00:00 2001 From: Matthew Alan Gray Date: Wed, 7 Feb 2024 08:52:56 -0600 Subject: [PATCH] Updating release build to pull version or tag from branch --- .github/workflows/release-docker-image.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-docker-image.yml b/.github/workflows/release-docker-image.yml index 91dacc5713..1e8f3e853c 100644 --- a/.github/workflows/release-docker-image.yml +++ b/.github/workflows/release-docker-image.yml @@ -26,10 +26,10 @@ jobs: - name: Fetching the Latest Release Tag number id: releaseVersion run: | - release_json=$(curl https://api.github.com/repos/${{ github.repository }}/releases) - release_tag=$(echo "$release_json" | jq -r '.[0].tag_name') - echo "release_tag: Latest Tag is : $release_tag" - echo "release_tag=$release_tag" >> $GITHUB_OUTPUT + GIT_RELEASE=$(${{ github.head_ref || github.ref_name }} | cut -d'/' -f 3) + echo "GIT_RELEASE=$GIT_RELEASE" >> $GITHUB_ENV + echo "release_tag: Latest Tag is : $GIT_RELEASE" + echo "release_tag=$GIT_RELEASE" >> $GITHUB_OUTPUT - name: Checkout code uses: actions/checkout@v2 @@ -50,9 +50,7 @@ jobs: tags: | type=raw,latest type=raw,release - type=pep440,pattern={{version}},value=${{ steps.releaseVersion.outputs.release_tag }} - type=pep440,pattern={{major}}.{{minor}},value=${{ steps.releaseVersion.outputs.release_tag }} - type=pep440,pattern={{major}},value=${{ steps.releaseVersion.outputs.release_tag }} + type=raw,${{ steps.releaseVersion.outputs.release_tag }} type=sha,format=long - name: Build and push Docker images