1
0
mirror of https://github.com/esphome/esphome.git synced 2025-06-20 07:15:47 +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

@ -120,13 +120,22 @@ def main():
parser.add_argument(
"-c", "--changed", action="store_true", help="Only run on changed files"
)
parser.add_argument(
"-b", "--branch", help="Branch to compare changed files against"
)
args = parser.parse_args()
if args.branch and not args.changed:
parser.error("--branch requires --changed")
files = git_ls_files()
files = filter(filter_component_files, files)
if args.changed:
changed = changed_files()
if args.branch:
changed = changed_files(args.branch)
else:
changed = changed_files()
files = [f for f in files if f in changed]
components = extract_component_names_array_from_files_array(files)