Skip to content

Commit ee0a49c

Browse files
authored
Fix artifact deletion loop for zsh (#4997)
Replace `for id in $artifact_ids` with a `while read` pipeline. In zsh, unquoted variable expansion doesn't split on newlines like bash, so all artifact IDs were concatenated into a single invalid URL.
1 parent 18dd6a7 commit ee0a49c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

.github/workflows/nightly-tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,10 @@ jobs:
100100
- name: Delete intermediate artifacts
101101
continue-on-error: true
102102
run: |
103-
artifact_ids=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts \
103+
gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts \
104104
--paginate --jq '.artifacts[]
105105
| select(.name | startswith("reftests-${{ matrix.preset }}-"))
106-
| .id')
107-
for id in $artifact_ids; do
106+
| .id' | while read id; do
108107
gh api -X DELETE repos/${{ github.repository }}/actions/artifacts/$id
109108
done
110109
env:

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,10 @@ jobs:
121121
- name: Delete intermediate artifacts
122122
continue-on-error: true
123123
run: |
124-
artifact_ids=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts \
124+
gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts \
125125
--paginate --jq '.artifacts[]
126126
| select(.name | startswith("reftests-${{ matrix.preset }}-"))
127-
| .id')
128-
for id in $artifact_ids; do
127+
| .id' | while read id; do
129128
gh api -X DELETE repos/${{ github.repository }}/actions/artifacts/$id
130129
done
131130
env:

0 commit comments

Comments
 (0)