diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index fd48d8f..57ce4e6 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -1,4 +1,4 @@ -name: "pre-release" +name: "Pre-release" on: push: @@ -10,7 +10,7 @@ on: jobs: pre-release: - name: "Pre Release" + name: "Pre-release" runs-on: ubuntu-22.04 steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c91b56f..88f3ceb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - name: Get previous tag id: previousTag run: | - name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1) + name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | grep -v 'latest' | tail -2 | head -1) echo "previousTag: $name" echo "previousTag=$name" >> $GITHUB_ENV @@ -41,3 +41,10 @@ jobs: name: ${{ github.ref_name }} body: ${{ steps.changelog.outputs.changes }} token: ${{ github.token }} + + - uses: dev-drprasad/delete-older-releases@v0.3.2 + with: + delete_prerelease_only: true + keep_latest: 0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}