From 2e7de9f7ba58190391182ff88037b06a221752cf Mon Sep 17 00:00:00 2001 From: Mirko Milovanovic Date: Mon, 10 Feb 2025 14:02:10 +0100 Subject: [PATCH] feat: add workflow step to delete old release assets before releasing new PDF artifact --- .github/workflows/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ebbbab..c708d5e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,6 +38,14 @@ jobs: - name: Check for PDF artifact run: file ${{ env.PDF_NAME }} || grep -q ' PDF ' + - name: Delete old release assets + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: mknejp/delete-release-assets@v1 + with: + token: ${{ github.RELEASE_TOKEN }} + tag: latest + assets: ${{ env.PDF_NAME }} + - name: Release PDF artifact if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: softprops/action-gh-release@v2