From 834d205c0e0b2c04c8609d5aec3f6abd3065c04d Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Thu, 9 May 2024 11:31:23 +0100 Subject: [PATCH] ci: remove old artifacts --- .github/workflows/ci.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a74e714..3b78953 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,18 +159,17 @@ jobs: path: src/ standard: phpcs.xml -# TODO: Figure this one out: -# remove_old_artifacts: -# runs-on: ubuntu-latest -# -# steps: -# - name: Remove old artifacts for prior workflow runs on this repository -# env: -# GH_TOKEN: ${{ github.token }} -# run: | -# gh api "/repos/${{ github.repository }}/actions/artifacts?name=build-artifact" | jq ".artifacts[] | select(.name | startswith(\"build-artifact\")) | .id" > artifact-id-list.txt -# while read id -# do -# echo -n "Deleting artifact ID $id ... " -# gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done" -# done artifact-id-list.txt + while read id + do + echo -n "Deleting artifact ID $id ... " + gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done" + done