From 1b09b62ab92b7471e8586c88eceddfc7bea615bf Mon Sep 17 00:00:00 2001 From: Bob Date: Sun, 22 Feb 2026 13:11:42 +0000 Subject: [PATCH] fix(ci): handle missing server log files in cleanup steps The "Print server logs" and "Move logs to subdir" steps fail when aw-server-rust master doesn't write logs to the expected path (~/.cache/activitywatch/log/*/*.log). The glob expands to a literal string that cat/mv can't find, causing the step to exit with code 1. Fix: use `shopt -s nullglob` + loop so empty globs produce no iterations instead of a failed glob expansion. --- .github/workflows/nodejs.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 3b76a3b8..735422c1 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -179,8 +179,9 @@ jobs: - name: Print server logs to console if: ${{ always() }} shell: bash - run: - for file in ~/.cache/activitywatch/log/*/*.log; do echo $file; cat $file; echo; done + run: | + shopt -s nullglob + for file in ~/.cache/activitywatch/log/*/*.log; do echo "$file"; cat "$file"; echo; done - name: Move logs to subdir # Run this step even if e2e tests flag failure if: ${{ always() }} @@ -189,7 +190,8 @@ jobs: aw_version: ${{ matrix.aw-version }} run: | mkdir -p logs/dist/$aw_server/$aw_version - mv ~/.cache/activitywatch/log/*/*.log logs/dist/$aw_server/$aw_version + shopt -s nullglob + for file in ~/.cache/activitywatch/log/*/*.log; do mv "$file" logs/dist/$aw_server/$aw_version/; done - name: Upload logs if: ${{ always() }} uses: actions/upload-artifact@v4