From 6523ca31e6c3a7f93ba55931409e3cea26f23f1f Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 14 Dec 2022 09:30:13 -0500 Subject: [PATCH] squash rebase pull requests Add the label to squash rebase pull requests automatically. Signed-off-by: Doug Hellmann --- scripts/auto-rebase/create_pr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/auto-rebase/create_pr.py b/scripts/auto-rebase/create_pr.py index fcbe5496a3..33c8a527ab 100755 --- a/scripts/auto-rebase/create_pr.py +++ b/scripts/auto-rebase/create_pr.py @@ -48,7 +48,8 @@ def create_or_get_pr_url(ghrepo): elif prs.totalCount > 1: print(f"Found several existing PRs for '{r.active_branch.name}': {[(x.state, x.html_url) for x in prs]}") else: - pr = ghrepo.create_pull(title=r.active_branch.name, body='', base='main', head=r.active_branch.name, maintainer_can_modify=True) + body = f"{r.active_branch.name}\n\n/label tide/merge-method-squash" + pr = ghrepo.create_pull(title=r.active_branch.name, body=body, base='main', head=r.active_branch.name, maintainer_can_modify=True) print(f"Created pull request: {pr.html_url}")