Skip to content

Commit 04c94b6

Browse files
committed
fix(ci): use if-statements in stage(), not bare [ -f ] && cp, for set -e safety
GitHub Actions runs each `run:` step under `bash -e`. A top-level `[ -f "$1" ] && cp ...` line is NOT exempt from -e the way an if-condition is: when the test is false, the line's exit status is 1 and the whole step aborts immediately — which is exactly what happened on the very first stage() call, since pdfium/encoder/bbox have no .data sidecar to copy. Rewriting as explicit if/fi blocks (which set -e does exempt) fixes it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DofkqhMuAJbL9arnnuVisL
1 parent 07a28b6 commit 04c94b6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/publish-models.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ jobs:
9090
run: |
9191
mkdir -p release-assets
9292
stage() { # <source-path> <asset-name>
93-
[ -f "$1" ] && cp "$1" "release-assets/$2"
94-
[ -f "$1.data" ] && cp "$1.data" "release-assets/$2.data"
93+
if [ -f "$1" ]; then cp "$1" "release-assets/$2"; fi
94+
if [ -f "$1.data" ]; then cp "$1.data" "release-assets/$2.data"; fi
9595
}
9696
stage third-party/lib/libpdfium.so libpdfium.so
9797
stage third-party/ocr_rec.onnx ocr_rec.onnx

0 commit comments

Comments
 (0)