From 66caf907fd90b3a1500c71905b525e319e0732a8 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Wed, 15 Jul 2026 02:52:03 -0400 Subject: [PATCH] [Fix] (CI): remove intermediate trace artifacts --- .github/workflows/apk.yml | 16 +++++++++++----- .github/workflows/test.yml | 16 +++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/apk.yml b/.github/workflows/apk.yml index 0d3aa568..a224237f 100644 --- a/.github/workflows/apk.yml +++ b/.github/workflows/apk.yml @@ -489,8 +489,14 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - gh api --paginate "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts?per_page=100" \ - --jq '.artifacts[] | select(.name | startswith("MobileGL-trace-fixture-") or startswith("MobileGL-android-retrace-result-")) | .id' | - while IFS= read -r artifact_id; do - gh api --method DELETE "repos/${GITHUB_REPOSITORY}/actions/artifacts/${artifact_id}" - done + mapfile -t artifacts < <( + gh api --paginate "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts?per_page=100" \ + --jq '.artifacts[] | select(.name | startswith("MobileGL-trace-fixture-") or startswith("MobileGL-android-retrace-result-") or startswith("trace-fixture-") or startswith("retrace-result-")) | [.id, .name] | @tsv' + ) + + echo "Found ${#artifacts[@]} intermediate Android artifact(s)." + for artifact in "${artifacts[@]}"; do + IFS=$'\t' read -r artifact_id artifact_name <<<"${artifact}" + echo "Deleting ${artifact_name} (${artifact_id})" + gh api --method DELETE "repos/${GITHUB_REPOSITORY}/actions/artifacts/${artifact_id}" + done diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d1e622df..5273a851 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -519,8 +519,14 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - gh api --paginate "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts?per_page=100" \ - --jq '.artifacts[] | select(.name | startswith("retrace-result-")) | .id' | - while IFS= read -r artifact_id; do - gh api --method DELETE "repos/${GITHUB_REPOSITORY}/actions/artifacts/${artifact_id}" - done + mapfile -t artifacts < <( + gh api --paginate "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts?per_page=100" \ + --jq '.artifacts[] | select(.name | startswith("trace-fixture-") or startswith("retrace-result-")) | [.id, .name] | @tsv' + ) + + echo "Found ${#artifacts[@]} intermediate Linux artifact(s)." + for artifact in "${artifacts[@]}"; do + IFS=$'\t' read -r artifact_id artifact_name <<<"${artifact}" + echo "Deleting ${artifact_name} (${artifact_id})" + gh api --method DELETE "repos/${GITHUB_REPOSITORY}/actions/artifacts/${artifact_id}" + done