diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f658a80..1b94e28 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,6 +22,18 @@ jobs: if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/checkout@v4 + with: + fetch-tags: true + - name: Capture latest tag if exists + uses: actions-ecosystem/action-get-latest-tag@v1 + id: get-latest-tag + with: + semver_only: true + with_initial_version: true + initial_version: v0.0.0 + - id: previous + run: | + echo tag="$(git tag -l 'v*' | grep -v '${{ steps.get-latest-tag.outputs.tag }}' | tail -n 1)" >> "$GITHUB_OUTPUT" - id: semver_parser uses: release-kit/semver@v2 with: @@ -30,7 +42,8 @@ jobs: uses: requarks/changelog-action@v1 with: token: ${{ github.token }} - tag: ${{ github.ref_name }} + fromTag: ${{ steps.previous.outputs.tag }} + toTag: ${{ github.ref_name }} excludeTypes: "" excludeScopes: "" - uses: ncipollo/release-action@v1.14.0