File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,24 @@ jobs:
154154 gh release upload "${release_tag}" "${artifact_name}" \
155155 -R ${{ github.repository }} --clobber
156156
157+ cleanup-artifacts :
158+ runs-on : ubuntu-latest
159+ if : success()
160+ needs : [pecl-release]
161+ steps :
162+ - name : Cleanup artifacts after successful release
163+ env :
164+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
165+ run : |
166+ echo "=== Deleting artifacts after successful release ==="
167+ artifact_ids=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[].id' 2>/dev/null || echo "")
168+ if [ -n "$artifact_ids" ]; then
169+ for artifact_id in $artifact_ids; do
170+ echo "Deleting artifact $artifact_id"
171+ gh api -X DELETE repos/${{ github.repository }}/actions/artifacts/$artifact_id || true
172+ done
173+ fi
174+
157175 cleanup-release :
158176 runs-on : ubuntu-latest
159177 if : failure()
You can’t perform that action at this time.
0 commit comments