Skip to content

Commit 1272594

Browse files
authored
Split git pathspecs in change determination onto separate lines (#16869)
1 parent 9d72685 commit 1272594

File tree

1 file changed

+53
-6
lines changed

1 file changed

+53
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,17 @@ jobs:
5858
env:
5959
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
6060
run: |
61-
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':Cargo.toml' ':Cargo.lock' ':crates/ruff_python_trivia/**' ':crates/ruff_source_file/**' ':crates/ruff_text_size/**' ':crates/ruff_python_ast/**' ':crates/ruff_python_parser/**' ':python/py-fuzzer/**' ':.github/workflows/ci.yaml'; then
61+
if git diff --quiet "${MERGE_BASE}...HEAD" -- \
62+
':Cargo.toml' \
63+
':Cargo.lock' \
64+
':crates/ruff_python_trivia/**' \
65+
':crates/ruff_source_file/**' \
66+
':crates/ruff_text_size/**' \
67+
':crates/ruff_python_ast/**' \
68+
':crates/ruff_python_parser/**' \
69+
':python/py-fuzzer/**' \
70+
':.github/workflows/ci.yaml' \
71+
; then
6272
echo "changed=false" >> "$GITHUB_OUTPUT"
6373
else
6474
echo "changed=true" >> "$GITHUB_OUTPUT"
@@ -69,7 +79,18 @@ jobs:
6979
env:
7080
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
7181
run: |
72-
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':Cargo.toml' ':Cargo.lock' ':crates/**' ':!crates/red_knot*/**' ':!crates/ruff_python_formatter/**' ':!crates/ruff_formatter/**' ':!crates/ruff_dev/**' ':!crates/ruff_db/**' ':scripts/*' ':python/**' ':.github/workflows/ci.yaml'; then
82+
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':Cargo.toml' \
83+
':Cargo.lock' \
84+
':crates/**' \
85+
':!crates/red_knot*/**' \
86+
':!crates/ruff_python_formatter/**' \
87+
':!crates/ruff_formatter/**' \
88+
':!crates/ruff_dev/**' \
89+
':!crates/ruff_db/**' \
90+
':scripts/*' \
91+
':python/**' \
92+
':.github/workflows/ci.yaml' \
93+
; then
7394
echo "changed=false" >> "$GITHUB_OUTPUT"
7495
else
7596
echo "changed=true" >> "$GITHUB_OUTPUT"
@@ -80,7 +101,21 @@ jobs:
80101
env:
81102
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
82103
run: |
83-
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':Cargo.toml' ':Cargo.lock' ':crates/ruff_python_formatter/**' ':crates/ruff_formatter/**' ':crates/ruff_python_trivia/**' ':crates/ruff_python_ast/**' ':crates/ruff_source_file/**' ':crates/ruff_python_index/**' ':crates/ruff_python_index/**' ':crates/ruff_text_size/**' ':crates/ruff_python_parser/**' ':scripts/*' ':python/**' ':.github/workflows/ci.yaml'; then
104+
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':Cargo.toml' \
105+
':Cargo.lock' \
106+
':crates/ruff_python_formatter/**' \
107+
':crates/ruff_formatter/**' \
108+
':crates/ruff_python_trivia/**' \
109+
':crates/ruff_python_ast/**' \
110+
':crates/ruff_source_file/**' \
111+
':crates/ruff_python_index/**' \
112+
':crates/ruff_python_index/**' \
113+
':crates/ruff_text_size/**' \
114+
':crates/ruff_python_parser/**' \
115+
':scripts/*' \
116+
':python/**' \
117+
':.github/workflows/ci.yaml' \
118+
; then
84119
echo "changed=false" >> "$GITHUB_OUTPUT"
85120
else
86121
echo "changed=true" >> "$GITHUB_OUTPUT"
@@ -91,7 +126,11 @@ jobs:
91126
env:
92127
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
93128
run: |
94-
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':Cargo.toml' ':Cargo.lock' ':fuzz/fuzz_targets/**' ':.github/workflows/ci.yaml'; then
129+
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':Cargo.toml' \
130+
':Cargo.lock' \
131+
':fuzz/fuzz_targets/**' \
132+
':.github/workflows/ci.yaml' \
133+
; then
95134
echo "changed=false" >> "$GITHUB_OUTPUT"
96135
else
97136
echo "changed=true" >> "$GITHUB_OUTPUT"
@@ -102,7 +141,13 @@ jobs:
102141
env:
103142
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
104143
run: |
105-
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':**/*' ':!**/*.md' ':crates/red_knot_python_semantic/resources/mdtest/**/*.md' ':!docs/**' ':!assets/**' ':.github/workflows/ci.yaml'; then
144+
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':**/*' \
145+
':!**/*.md' \
146+
':crates/red_knot_python_semantic/resources/mdtest/**/*.md' \
147+
':!docs/**' \
148+
':!assets/**' \
149+
':.github/workflows/ci.yaml' \
150+
; then
106151
echo "changed=false" >> "$GITHUB_OUTPUT"
107152
else
108153
echo "changed=true" >> "$GITHUB_OUTPUT"
@@ -113,7 +158,9 @@ jobs:
113158
env:
114159
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
115160
run: |
116-
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':playground/**'; then
161+
if git diff --quiet "${MERGE_BASE}...HEAD" -- \
162+
':playground/**' \
163+
; then
117164
echo "changed=false" >> "$GITHUB_OUTPUT"
118165
else
119166
echo "changed=true" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)