Skip to content

Commit

Permalink
testit
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta50 committed Sep 18, 2024
1 parent b2cfcc5 commit 18ff26e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/hostplumber-multiarch-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions get-label.bash
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash
#First set the suffix to some value, either Teamcity build-id or <abbrev-sha1>
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
TAG=$(git describe --tags HEAD)
if [[ $? -ne 0 ]]
then
# if we cannot get the tag, lets use the <branch>-pmk-<suffix> 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
echo ${{ env.TAG }}

0 comments on commit 18ff26e

Please sign in to comment.