Skip to content

Commit 47d3007

Browse files
committed
Fix: fix the error when multiple changed files were flattened to one line
Signed-off-by: Hanxi Zhang <[email protected]>
1 parent cf67691 commit 47d3007

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
# For pushes to mainline or PRs targeting mainline, only build changed versions
3838
if [[ ("${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/mainline")]] ; then
3939
changed_files=$(git diff --name-only HEAD~1 HEAD)
40-
if echo $changed_files | grep -qE "^(versions\.json|[0-9]+\.[0-9]+/|unstable/)"; then
40+
if printf "%s\n" "$changed_files" | grep -qE "^(versions\.json|[0-9]+\.[0-9]+/|unstable/)"; then
4141
changed_versions=$(echo $changed_files | grep -oE "[0-9]+\.[0-9]+|unstable" | sort -u | tr '\n' '|' | sed 's/|$//')
4242
if [[ -n "$changed_versions" ]]; then
4343
strategy=$(jq -c --arg versions "$changed_versions" '{"fail-fast": .["fail-fast"],"matrix":{"include":[ .matrix.include[]|select(.meta.entries[0].directory | test($versions))]}}' <<<"$strategy")

0 commit comments

Comments
 (0)