Skip to content

Commit 646384c

Browse files
committed
Fix shell script error when all changed files are in .github/
- Add '|| true' to grep command to prevent exit code 1 when no matches - Add check for non-empty filtered file list before pattern matching - Ensures clean skip of documentation deployment for .github/ only changes
1 parent 7b42773 commit 646384c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ jobs:
6363
echo "Changed files: $CHANGED_FILES"
6464
6565
# Filter out .github/ directory files and check for documentation-related changes
66-
DOC_CHANGED_FILES=$(echo "$CHANGED_FILES" | grep -v '^\.github/')
66+
DOC_CHANGED_FILES=$(echo "$CHANGED_FILES" | grep -v '^\.github/' || true)
6767
echo "Non-.github files: $DOC_CHANGED_FILES"
6868
69-
if echo "$DOC_CHANGED_FILES" | grep -qE '(^src/|^docs/|\.md$|Project\.toml$|Manifest\.toml$)'; then
69+
if [ -n "$DOC_CHANGED_FILES" ] && echo "$DOC_CHANGED_FILES" | grep -qE '(^src/|^docs/|\.md$|Project\.toml$|Manifest\.toml$)'; then
7070
echo "Documentation-related files changed - deploying docs"
7171
echo "docs_changed=true" >> $GITHUB_OUTPUT
7272
else

0 commit comments

Comments
 (0)