Skip to content

Commit ccc77c4

Browse files
fix(ci): handle missing server log files in cleanup steps
When aw-server-rust doesn't produce log files (e.g. logs go to stdout/stderr instead of files), the glob pattern in the cleanup steps fails because bash treats unmatched globs as literal strings. Fix: use `shopt -s nullglob` so unmatched globs expand to nothing, and switch `mv` to a for-loop that handles the empty case. This was causing false CI failures on the "aw-server-rust master" test matrix entry for every PR.
1 parent 1393ec6 commit ccc77c4

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,9 @@ jobs:
179179
- name: Print server logs to console
180180
if: ${{ always() }}
181181
shell: bash
182-
run:
183-
for file in ~/.cache/activitywatch/log/*/*.log; do echo $file; cat $file; echo; done
182+
run: |
183+
shopt -s nullglob
184+
for file in ~/.cache/activitywatch/log/*/*.log; do echo "$file"; cat "$file"; echo; done
184185
- name: Move logs to subdir
185186
# Run this step even if e2e tests flag failure
186187
if: ${{ always() }}
@@ -189,7 +190,8 @@ jobs:
189190
aw_version: ${{ matrix.aw-version }}
190191
run: |
191192
mkdir -p logs/dist/$aw_server/$aw_version
192-
mv ~/.cache/activitywatch/log/*/*.log logs/dist/$aw_server/$aw_version
193+
shopt -s nullglob
194+
for file in ~/.cache/activitywatch/log/*/*.log; do mv "$file" "logs/dist/$aw_server/$aw_version/"; done
193195
- name: Upload logs
194196
if: ${{ always() }}
195197
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)