Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
saranagaoka authored Dec 7, 2023
1 parent bea372c commit c81907b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
run: |
VERSION_PREFIX="v"
CURRENT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "${VERSION_PREFIX}0.0.0")
echo "CURRENT_TAG: $CURRENT_TAG"
CURRENT_VERSION=${CURRENT_TAG#$VERSION_PREFIX}
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
if [[ "${{ github.ref }}" == "refs/heads/prod" ]]; then
Expand All @@ -36,8 +37,9 @@ jobs:
fi
NEW_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}"
NEW_TAG="$VERSION_PREFIX$NEW_VERSION"
echo "NEW_TAG: $NEW_TAG"
git tag $NEW_TAG
git push origin $NEW_TAG
git push origin $NEW_TAG || echo "Failed to push tag"
echo ::set-output name=TAG_NAME::$NEW_TAG
- name: Create Release
Expand Down

0 comments on commit c81907b

Please sign in to comment.