From 92110534caa011f68574cc7c762c0dfc042dfd6d Mon Sep 17 00:00:00 2001 From: Enes Hoxha Date: Tue, 10 Dec 2024 14:49:29 +0100 Subject: [PATCH] update sdk-release --- .github/workflows/sdk-release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sdk-release.yml b/.github/workflows/sdk-release.yml index 7c010b0..4e7c4f0 100644 --- a/.github/workflows/sdk-release.yml +++ b/.github/workflows/sdk-release.yml @@ -34,8 +34,11 @@ jobs: id: versioning if: ${{ steps.check_merge.outputs.merged == 'true' }} run: | - labels=$(echo "${{ toJSON(github.event.pull_request.labels) }}" | jq -r '.[].name') + PR_LABELS="${{ toJSON(github.event.pull_request.labels) }}" + # Parse PR labels using jq + labels=$(jq -r '.[].name' <<< "$PR_LABELS") echo "PR labels: $labels" + increment="patch" if echo "$labels" | grep -q "feature"; then increment="minor" @@ -76,6 +79,7 @@ jobs: major=${versionParts[0]} minor=${versionParts[1]} patch=${versionParts[2]} + if [ "$increment" == 'minor' ]; then minor=$((minor + 1)) patch=0 @@ -85,6 +89,7 @@ jobs: echo "Unknown increment type: $increment" exit 1 fi + newVersion="$major.$minor.$patch" echo "New version: $newVersion" echo "newVersion=$newVersion" >> $GITHUB_OUTPUT