Skip to content

Commit 3b34341

Browse files
committed
Fix: CI job incorrectly skipped by file change detection
Updated the CI workflow to correctly detect changes in non-documentation and YAML files, preventing accidental skips of the CI job.
1 parent 51ddc98 commit 3b34341

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,23 @@ jobs:
4040
# If no files are changed at all, then `grep -v` will match even though no change outputs
4141
# should be true. Skipping output on an empty set of changes eliminates the false positive
4242
if [[ -n "${CHANGED_FILES}" ]]; then
43-
NON_DOCS=$(echo "${CHANGED_FILES}" | grep -Eqv '\.md$' && echo 'true' || echo 'false')
44-
YAML=$(echo "${CHANGED_FILES}" | grep -Eq '\.ya?ml$' && echo 'true' || echo 'false')
43+
NON_DOCS='false'
44+
YAML='false'
45+
46+
while read -r file; do
47+
if [[ "$file" != *.md ]]; then
48+
NON_DOCS='true'
49+
break
50+
fi
51+
done <<< "${CHANGED_FILES}"
52+
53+
while read -r file; do
54+
if [[ "$file" == *.yaml || "$file" == *.yml ]]; then
55+
YAML='true'
56+
break
57+
fi
58+
done <<< "${CHANGED_FILES}"
59+
4560
echo "non-docs=${NON_DOCS}" | tee -a $GITHUB_OUTPUT
4661
echo "yaml=${YAML}" | tee -a $GITHUB_OUTPUT
4762
fi

0 commit comments

Comments
 (0)