Skip to content

Commit

Permalink
wip: remove old artifactgs
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Dec 30, 2023
1 parent 20b6498 commit c221d03
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Upload build archive for test runners
uses: actions/upload-artifact@v4
with:
name: build-artifact-${{ runner.os }}-${{ matrix.php }}
name: build-php${{ matrix.php }}
path: /tmp/github-actions

phpunit:
Expand All @@ -42,7 +42,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: build-artifact-${{ runner.os }}-${{ matrix.php }}
name: build-php${{ matrix.php }}
path: /tmp/github-actions

- name: Extract build archive
Expand All @@ -67,7 +67,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: build-artifact-${{ runner.os }}-${{ matrix.php }}
name: build-php${{ matrix.php }}
path: /tmp/github-actions

- name: Extract build archive
Expand All @@ -78,3 +78,18 @@ jobs:
with:
path: src/
php_version: ${{ matrix.php }}

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" | jq ".artifacts[] | select(.name == \"build\") | .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 c221d03

Please sign in to comment.