Skip to content

Commit bd593d5

Browse files
committed
fix(ci): handle files without trailing newline in vale-check.sh
Add `|| [[ -n "$f" ]]` to while read loops to catch the last line even when input doesn't end with a newline. This is a common bash pitfall where `while read` skips the final line without a terminator.
1 parent 72c8752 commit bd593d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/scripts/vale-check.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ while [[ $# -gt 0 ]]; do
2121
case "$1" in
2222
--files)
2323
shift
24-
while IFS= read -r f; do
24+
while IFS= read -r f || [[ -n "$f" ]]; do
2525
[[ -n "$f" ]] && FILES+=("$f")
2626
done < "$1"
2727
shift
@@ -35,7 +35,7 @@ done
3535

3636
# Read from stdin if no files provided
3737
if [[ ${#FILES[@]} -eq 0 ]]; then
38-
while IFS= read -r f; do
38+
while IFS= read -r f || [[ -n "$f" ]]; do
3939
[[ -n "$f" ]] && FILES+=("$f")
4040
done
4141
fi

0 commit comments

Comments
 (0)