Skip to content

Commit 6e37964

Browse files
committed
Harden Compress artifact step
1 parent 4716cce commit 6e37964

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/system-tests.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,12 @@ jobs:
176176

177177
- name: Compress artifact
178178
if: ${{ always() }}
179-
run: tar -czvf artifact.tar.gz $(ls | grep logs)
179+
run: |
180+
if compgen -G "logs*/" > /dev/null; then
181+
tar -czvf artifact.tar.gz logs*/
182+
else
183+
echo "No logs*/ found; skipping tar."
184+
fi
180185
181186
- name: Upload artifact
182187
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
@@ -247,7 +252,12 @@ jobs:
247252

248253
- name: Compress artifact
249254
if: ${{ always() }}
250-
run: tar -czvf artifact.tar.gz $(ls | grep logs)
255+
run: |
256+
if compgen -G "logs*/" > /dev/null; then
257+
tar -czvf artifact.tar.gz logs*/
258+
else
259+
echo "No logs*/ found; skipping tar."
260+
fi
251261
252262
- name: Upload artifact
253263
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

0 commit comments

Comments
 (0)