1
0
mirror of https://github.com/esphome/esphome.git synced 2025-06-18 06:15:46 +01:00

Fix list-components when PR is not targeting dev ()

This commit is contained in:
Jesse Hills
2024-03-16 14:22:34 +13:00
committed by GitHub
parent 5d96b5c52b
commit 1148d41a66
3 changed files with 22 additions and 8 deletions
.github/workflows
script

@ -70,11 +70,11 @@ def splitlines_no_ends(string):
return [s.strip() for s in string.splitlines()]
def changed_files():
def changed_files(branch="dev"):
check_remotes = ["upstream", "origin"]
check_remotes.extend(splitlines_no_ends(get_output("git", "remote")))
for remote in check_remotes:
command = ["git", "merge-base", f"refs/remotes/{remote}/dev", "HEAD"]
command = ["git", "merge-base", f"refs/remotes/{remote}/{branch}", "HEAD"]
try:
merge_base = splitlines_no_ends(get_output(*command))[0]
break