From 18ff26ed3a9913cf5719490753ea785efc6b6583 Mon Sep 17 00:00:00 2001 From: Shweta chavan Date: Wed, 18 Sep 2024 11:25:32 +0530 Subject: [PATCH] testit --- .../workflows/hostplumber-multiarch-build-and-push.yml | 7 ++++--- get-label.bash | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/hostplumber-multiarch-build-and-push.yml b/.github/workflows/hostplumber-multiarch-build-and-push.yml index 6b957ed6..f1ea1e26 100644 --- a/.github/workflows/hostplumber-multiarch-build-and-push.yml +++ b/.github/workflows/hostplumber-multiarch-build-and-push.yml @@ -27,10 +27,11 @@ jobs: - name: Set env run: - if startsWith(${{ env.BRANCH }}, 'v*') - echo "TAG=$(echo "${{ env.BRANCH }}") >> $GITHUB_ENV + echo "TAG=$(echo "${{ env.BRANCH }}" | tr -d /)" >> $GITHUB_ENV + if startsWith(${{ env.TAG }}, 'v*') + echo "TAG=$(echo "${{ env.BRANCH }}") >> $GITHUB_ENV else - echo "TAG=$(echo "${{ env.BRANCH }}" | tr -d /)"-${{ github.run_number }} >> $GITHUB_ENV + echo "TAG=$(echo "${{ env.BRANCH }}")-${{ github.run_number }} >> $GITHUB_ENV fi - uses: actions/checkout@v3 diff --git a/get-label.bash b/get-label.bash index 25c08792..39855b69 100755 --- a/get-label.bash +++ b/get-label.bash @@ -1,9 +1,9 @@ #!/bin/bash #First set the suffix to some value, either Teamcity build-id or -if [[ -z "${TEAMCITY_BUILD_ID}" ]]; then +if [[ -z "${{ github.run_number }}" ]]; then SUFFIX=$(git rev-parse --short HEAD) else - SUFFIX=${TEAMCITY_BUILD_ID} + SUFFIX=${{ github.run_number }} fi # Get the tag as the version @@ -11,8 +11,8 @@ TAG=$(git describe --tags HEAD) if [[ $? -ne 0 ]] then # if we cannot get the tag, lets use the -pmk- as the tag name - TAG=$(git rev-parse --abbrev-ref HEAD | sed 's/[^a-zA-Z0-9_.]/-/g')-pmk-${SUFFIX} + echo "TAG=$(git rev-parse --abbrev-ref HEAD | sed 's/[^a-zA-Z0-9_.]/-/g')-pmk-${SUFFIX}" >> $GITHUB_ENV else - TAG=$(echo $TAG | sed 's/-.*//')-pmk-${SUFFIX} + echo "TAG=$(echo $TAG | sed 's/-.*//')-pmk-${SUFFIX}" >> $GITHUB_ENV fi -echo $TAG \ No newline at end of file +echo ${{ env.TAG }}