From 3011a4406feae44662738f4e95843861fc0d6745 Mon Sep 17 00:00:00 2001 From: Nikita Shulga <2453524+malfet@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:18:23 +0000 Subject: [PATCH] [BE][GHF] Do not hardcode default branch name (#118530) Instead rely on `GitHubPR.default_branch()` which is the name of the repo's default branch. Do not pass branch name `merge_changes` is called, as it is set to default branch inside the function Pull Request resolved: https://github.com/pytorch/pytorch/pull/118530 Approved by: https://github.com/clee2000 --- .github/scripts/trymerge.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/scripts/trymerge.py b/.github/scripts/trymerge.py index 32047d9aa110..7c5c4a932076 100755 --- a/.github/scripts/trymerge.py +++ b/.github/scripts/trymerge.py @@ -748,7 +748,7 @@ class GitHubPR: # work for ghstack where the base is the custom branch, i.e. gh/USER/ID/base, # so let's just use main instead self.merge_base = gh_fetch_merge_base( - self.org, self.project, last_commit_oid, "main" + self.org, self.project, last_commit_oid, self.default_branch() ) # Fallback to baseRefOid if the API call fails, i.e. rate limit. Note that baseRefOid @@ -2307,7 +2307,6 @@ def main() -> None: get_ghstack_prs(repo, pr) # raises error if out of sync pr.merge_changes( repo, - branch="main", skip_mandatory_checks=True, skip_all_rule_checks=True, )