File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed
Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 1313 - uses : actions/checkout@v4
1414
1515 - name : Cache Composer dependencies
16- uses : actions/cache@v3
16+ uses : actions/cache@v4
1717 with :
1818 path : /tmp/composer-cache
1919 key : ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
2424 php_version : ${{ matrix.php }}
2525
2626 - name : Archive build
27- run : mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
27+ run : mkdir /tmp/github-actions/ && tar --exclude=".git" - cvf /tmp/github-actions/build.tar ./
2828
2929 - name : Upload build archive for test runners
3030 uses : actions/upload-artifact@v4
@@ -158,3 +158,21 @@ jobs:
158158 php_version : ${{ matrix.php }}
159159 path : src/
160160 standard : phpcs.xml
161+
162+ remove_old_artifacts :
163+ runs-on : ubuntu-latest
164+
165+ permissions :
166+ actions : write
167+
168+ steps :
169+ - name : Remove old artifacts for prior workflow runs on this repository
170+ env :
171+ GH_TOKEN : ${{ github.token }}
172+ run : |
173+ gh api "/repos/${{ github.repository }}/actions/artifacts" | jq ".artifacts[] | select(.name | startswith(\"build-artifact\")) | .id" > artifact-id-list.txt
174+ while read id
175+ do
176+ echo -n "Deleting artifact ID $id ... "
177+ gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done"
178+ done <artifact-id-list.txt
You can’t perform that action at this time.
0 commit comments