File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
autogpt_platform/backend/backend/blocks/github Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -553,12 +553,11 @@ async def run(
553
553
554
554
555
555
def prepare_pr_api_url (pr_url : str , path : str ) -> str :
556
- pattern = r"^(?:https?://)?github\.com/([^/]+/[^/]+)/pull/(\d+)"
556
+ # Pattern to capture the base repository URL and the pull request number
557
+ pattern = r"^(?:https?://)?([^/]+/[^/]+/[^/]+)/pull/(\d+)"
557
558
match = re .match (pattern , pr_url )
558
559
if not match :
559
- raise ValueError (
560
- f"Invalid GitHub PR URL: { pr_url } . URL must be a valid pull request URL, e.g., https://github.com/owner/repo/pull/123"
561
- )
560
+ return pr_url
562
561
563
- repo_path , pr_number = match .groups ()
564
- return f"{ repo_path } /pulls/{ pr_number } /{ path } "
562
+ base_url , pr_number = match .groups ()
563
+ return f"{ base_url } /pulls/{ pr_number } /{ path } "
You can’t perform that action at this time.
0 commit comments