From fe15e46bd34d51c8e5cc7907c5bae77b7b1dc579 Mon Sep 17 00:00:00 2001 From: Mateusz Urbanek Date: Thu, 12 Dec 2024 10:13:28 +0100 Subject: [PATCH] ci: ensure proper changelog generation Signed-off-by: Mateusz Urbanek --- .github/workflows/release.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f658a80..6ff6c76 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-depth: 0 + - 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 }} + toTag: ${{ steps.previous.outputs.tag }} + fromTag: ${{ github.ref_name }} excludeTypes: "" excludeScopes: "" - uses: ncipollo/release-action@v1.14.0