Skip to content

Commit

Permalink
ci: remove old artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed May 9, 2024
1 parent fea0d65 commit 834d205
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit 834d205

Please sign in to comment.