diff --git a/.gitea/workflows/android_build.yml b/.gitea/workflows/android_build.yml index 544b13b..db3e2d5 100644 --- a/.gitea/workflows/android_build.yml +++ b/.gitea/workflows/android_build.yml @@ -30,17 +30,27 @@ jobs: - name: Get commit message and determine version bump id: version run: | - COMMIT_MSG="${{ github.event.head_commit.message }}" - + COMMIT_MSG=$(git log -1 --pretty=%B) + HEAD_REF="${{ github.head_ref }}" + echo "DEBUG: Commit message: '$COMMIT_MSG'" + echo "DEBUG: Head ref: '$HEAD_REF'" + if [[ $COMMIT_MSG == [fix]* ]]; then BUMP_TYPE="patch" elif [[ $COMMIT_MSG == [feature]* ]]; then BUMP_TYPE="minor" elif [[ $COMMIT_MSG == [release]* ]]; then BUMP_TYPE="major" + elif [[ $HEAD_REF == fix/* ]]; then + BUMP_TYPE="patch" + elif [[ $HEAD_REF == feature/* ]] || [[ $HEAD_REF == feat/* ]]; then + BUMP_TYPE="minor" + elif [[ $HEAD_REF == release/* ]] || [[ $HEAD_REF == hotfix/* ]]; then + BUMP_TYPE="major" else BUMP_TYPE="none" fi + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") LATEST_TAG=${LATEST_TAG#v}