[llvm] Have merge script detect whether to use https or ssh to connect to github. (PR #218380)
Cullen Rhodes via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 05:56:48 PDT 2026
================
@@ -141,11 +141,19 @@ def load_pr_data(self):
)
self.prdata = json.loads(o)
+ # Determine if we use https or ssh to connect to github
+ remote = subprocess.run(
+ ["git", "remote", "get-url", self.args.upstream],
+ capture_output=True,
+ text=True,
+ )
+ upstream_remote_type = remote.stdout.strip().replace("llvm/llvm-project.git", "")
+
# save the baseRefName (target branch) so that we know where to push
self.target_branch = self.prdata["baseRefName"]
srepo = self.prdata["headRepository"]["name"]
sowner = self.prdata["headRepositoryOwner"]["login"]
- self.source_url = f"https://github.com/{sowner}/{srepo}"
+ self.source_url = f"{upstream_remote_type}{sowner}/{srepo}"
----------------
c-rhodes wrote:
I think the fix makes sense, it makes it more robust and requires less setup
https://github.com/llvm/llvm-project/pull/218380
More information about the llvm-commits
mailing list