Skip to content

Commit c12e208

Browse files
authored
Update pecl.yml
1 parent 9358cb3 commit c12e208

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/pecl.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)