diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 728b9c4..e6728a4 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -10,6 +10,9 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Determine version update type id: determine_version run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4105f6c..92031a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,21 +34,23 @@ jobs: - name: Extract version and previous tag id: extract_info run: | - TAG_NAME=${GITHUB_REF#refs/tags/} - VERSION=$TAG_NAME - PREVIOUS_TAG=$(git describe --tags $(git rev-list --tags --skip=1 --max-count=1)) + VERSION=${GITHUB_REF#refs/tags/v} + PREVIOUS_TAG=$(git describe --tags $(git rev-list --tags $GITHUB_SHA --skip=1 --max-count=1)) echo "VERSION=$VERSION" >> $GITHUB_ENV echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> $GITHUB_ENV - name: Determine update type id: determine_update_type run: | - IFS='.' read -r -a NEW_VERSION_PARTS <<< "${VERSION#v}" + IFS='.' read -r -a NEW_VERSION_PARTS <<< "${VERSION}" IFS='.' read -r -a OLD_VERSION_PARTS <<< "${PREVIOUS_TAG#v}" - if [ "${NEW_VERSION_PARTS[0]}" -ne "${OLD_VERSION_PARTS[0]}" ]; then + echo "New version parts: ${NEW_VERSION_PARTS[@]}" + echo "Old version parts: ${OLD_VERSION_PARTS[@]}" + + if [ "${NEW_VERSION_PARTS[0]}" != "${OLD_VERSION_PARTS[0]}" ]; then UPDATE_TYPE=major - elif [ "${NEW_VERSION_PARTS[1]}" -ne "${OLD_VERSION_PARTS[1]}" ]; then + elif [ "${NEW_VERSION_PARTS[1]}" != "${OLD_VERSION_PARTS[1]}" ]; then UPDATE_TYPE=minor else UPDATE_TYPE=patch