From 5c911cd48a68c87d1f23ff6d598bb3ca939ab9b1 Mon Sep 17 00:00:00 2001 From: Mirko Milovanovic Date: Mon, 10 Feb 2025 16:16:57 +0100 Subject: [PATCH] test delete --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 71081a8..002df1c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,9 +42,12 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/main' run: | latest_release_id=$(curl -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" https://gitea.kobim.cloud/api/v1/repos/${{ github.repository }}/releases/tags/latest | jq -r '.id') + echo "Latest release query: curl -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" https://gitea.kobim.cloud/api/v1/repos/${{ github.repository }}/releases/tags/latest | jq -r '.id'" assets=$(curl -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" https://gitea.kobim.cloud/api/v1/repos/${{ github.repository }}/releases/$latest_release_id/assets | jq -r '.[] | select(.name == "'${{ env.PDF_NAME }}'") | .id') + echo "Assets query: curl -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" https://gitea.kobim.cloud/api/v1/repos/${{ github.repository }}/releases/$latest_release_id/assets | jq -r '.[] | select(.name == "'${{ env.PDF_NAME }}'") | .id'" for asset_id in $assets; do curl -X DELETE -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" https://gitea.kobim.cloud/api/v1/repos/${{ github.repository }}/releases/assets/$asset_id + echo "Deleted asset $asset_id" done - name: Release PDF artifact