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 2632412 commit d2fa7ed
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- name: Create Tag
id: create_tag
env:
GITHUB_REF: ${{ github.ref }}
run: |
set -x
VERSION_PREFIX="v"
Expand All @@ -29,11 +31,11 @@ jobs:
CURRENT_VERSION=${CURRENT_TAG#$VERSION_PREFIX}
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
echo "VERSION_PARTS: ${VERSION_PARTS[@]}"
if [[ "${{ github.ref }}" == 'refs/heads/prod' ]]; then
if [[ "$GITHUB_REF" == 'refs/heads/prod' ]]; then
VERSION_PARTS[0]=$((VERSION_PARTS[0] + 1))
VERSION_PARTS[1]=0
VERSION_PARTS[2]=0
elif [[ "${{ github.ref }}" == 'refs/heads/master' ]]; then
elif [[ "$GITHUB_REF" == 'refs/heads/master' ]]; then
VERSION_PARTS[2]=$((VERSION_PARTS[2] + 1))
else
VERSION_PARTS[1]=$((VERSION_PARTS[1] + 1))
Expand All @@ -57,3 +59,9 @@ jobs:
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.create_tag.outputs.TAG_NAME }}
release_name: Release ${{ steps.create_tag.outputs.TAG_NAME }}
draft: false
prerelease: false

0 comments on commit d2fa7ed

Please sign in to comment.