diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3221880..ff6bbe8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,3 +71,22 @@ jobs: run: | rm -rf ./_sprites/sorted rm -rf ./_sprites/sorted-merged + + - name: Delete Old Artifacts + uses: actions/github-script@v6 + id: artifact + with: + script: | + const res = await github.rest.actions.listArtifactsForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + }) + + res.data.artifacts + .forEach(({ id }) => { + github.rest.actions.deleteArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: id, + }) + })