From c87c0f7e8b8a5e6ebae0297290935939b28115bd Mon Sep 17 00:00:00 2001 From: Rob Bos Date: Tue, 1 Aug 2023 19:32:33 +0200 Subject: [PATCH] Prevent url clipping for GHES instances (#1225) Signed-off-by: Rob Bos --- github/github.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/github/github.go b/github/github.go index 28590265..57863c38 100644 --- a/github/github.go +++ b/github/github.go @@ -85,11 +85,7 @@ func (c *Client) ParseFromURL(baseRepoURL, repoName string) (RepoInfo, error) { if err != nil { return ret, fmt.Errorf("parsing base repo URL: %w", err) } - - repoURL, err := baseURL.Parse(fmt.Sprintf("repos/%s", repoName)) - if err != nil { - return ret, fmt.Errorf("parsing repo endpoint: %w", err) - } + repoURL := baseURL.JoinPath(fmt.Sprintf("repos/%s", repoName)) log.Printf("getting repo info from URL: %s", repoURL.String()) //nolint:noctx