Skip to content

Commit 5f9811e

Browse files
authored
fix: resolve GITHUB_OUTPUT invalid format for zero changed files
1 parent 1ec0ff9 commit 5f9811e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/lint.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ jobs:
3434
| grep -E '\.(cpp|h)$' \
3535
| grep -v '/translations/' \
3636
|| true)
37-
COUNT=$(echo "$SRC_FILES" | grep -c . || echo 0)
38-
echo "count=$COUNT" >> $GITHUB_OUTPUT
37+
if [ -z "$SRC_FILES" ]; then
38+
COUNT=0
39+
else
40+
COUNT=$(echo "$SRC_FILES" | grep -c .)
41+
fi
42+
echo "count=${COUNT}" >> "$GITHUB_OUTPUT"
3943
if [ "$COUNT" = "0" ]; then
4044
echo "No changed source files to check."
4145
exit 0

0 commit comments

Comments
 (0)