mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01:43 -05:00
[ci] fix determine_tests_to_run.py by finding merge base (#26790)
We previously found all differences between origin/master and the PR branch, which includes forward changes if origin/master is ahead of the branch. By finding file differences with respect to the merge base we will only include actually changed files. See https://matthew-brett.github.io/pydagogue/git_diff_dots.html Signed-off-by: Kai Fricke <kai@anyscale.com>
This commit is contained in:
parent
c29a754526
commit
7cf4f8e069
1 changed files with 2 additions and 2 deletions
|
@ -54,9 +54,9 @@ def get_commit_range():
|
|||
with open(os.environ["GITHUB_EVENT_PATH"], "rb") as f:
|
||||
event = json.loads(f.read())
|
||||
base = event["pull_request"]["base"]["sha"]
|
||||
commit_range = "{}...{}".format(base, event.get("after", ""))
|
||||
commit_range = "{}..{}".format(base, event.get("after", ""))
|
||||
elif os.environ.get("BUILDKITE"):
|
||||
commit_range = "origin/{}...{}".format(
|
||||
commit_range = "origin/{}..{}".format(
|
||||
os.environ["BUILDKITE_PULL_REQUEST_BASE_BRANCH"],
|
||||
os.environ["BUILDKITE_COMMIT"],
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue