Skip to content

Commit 5bf83cb

Browse files
committed
fix(ci): do not crash if file in repo root is modified
by unconditionally grabbing the second part of the path of a modified file in `run_all_tests()`, we ended up indexing out of bounds if a modified file does not _have_ a second component in its path (e.g. if the file is at the repository root, like `Cargo.lock`). Fix this by checking for the length of x.parts first, and using python's short-circuiting behavior of logical operators. Signed-off-by: Patrick Roy <[email protected]>
1 parent 9f7c093 commit 5bf83cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.buildkite/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def run_all_tests(changed_files):
129129
return not changed_files or any(
130130
x.suffix != ".md"
131131
and not (x.parts[0] == ".github" and x.suffix == ".yml")
132-
and x.parts[1] != "hiding_ci"
132+
and (len(x.parts) < 2 or x.parts[1] != "hiding_ci")
133133
for x in changed_files
134134
)
135135

0 commit comments

Comments
 (0)