From 893562ca734d81db781c638cce4dfe5bcd985754 Mon Sep 17 00:00:00 2001 From: Adam Bouqdib Date: Sat, 3 Aug 2024 17:56:42 +0100 Subject: [PATCH] fix(gitlab): release file URL broken (#5035) Fix the GitLab upload URL. Gitlab changed upload URLs from `https://gitlab.com/{user}/{repo}/uploads/{hash}/file.ext` to `https://gitlab.com/-/project/{projectID}/uploads/{hash}/file.ext`. To avoid future issues like this the PR https://github.com/xanzy/go-gitlab/pull/1968 was created upstream which adds the `full_path` field to `go-gitlab` which this PR uses. Fixes https://github.com/goreleaser/goreleaser/issues/4974 --- internal/client/gitlab.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/client/gitlab.go b/internal/client/gitlab.go index 9c040dce9..265535967 100644 --- a/internal/client/gitlab.go +++ b/internal/client/gitlab.go @@ -523,12 +523,7 @@ func (c *gitlabClient) Upload( return fmt.Errorf("templating GitLab Download URL: %w", err) } - // search for project details based on projectID - projectDetails, _, err := c.client.Projects.GetProject(projectID, nil) - if err != nil { - return err - } - linkURL = gitlabBaseURL + "/" + projectDetails.PathWithNamespace + baseLinkURL + linkURL = gitlabBaseURL + "/" + projectFile.FullPath } log.WithField("file", file.Name()).