-
-
Notifications
You must be signed in to change notification settings - Fork 958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gitea Publish URL contains an extra / #3487
Comments
so, we could basically strip any trailing |
I think so? I have tried applying the below patch as a naïve fix and both the tests passed and the URL was correct when supplying the .yaml file with the trailing slash. diff --git a/internal/pipe/defaults/defaults.go b/internal/pipe/defaults/defaults.go
index 4bdfeb1c..f947e69c 100644
--- a/internal/pipe/defaults/defaults.go
+++ b/internal/pipe/defaults/defaults.go
@@ -36,6 +36,7 @@ func (Pipe) Run(ctx *context.Context) error {
}
ctx.Config.GiteaURLs.Download = strings.ReplaceAll(apiURL, "/api/v1", "")
+ ctx.Config.GiteaURLs.Download = strings.TrimSuffix(apiURL, "/")
}
for _, defaulter := range defaults.Defaulters {
if err := errhandler.Handle(defaulter.Default)(ctx); err != nil { |
yeah, looks like a fix.. wanna pr it? |
Sure. If I have documentation changes, should those be separate? |
Fixes goreleaser#3487 Signed-off-by: Sam Therapy <sam@samtherapy.net>
nope, same pr is fine :) docs are all in the |
This PR will truncate any trailing slash left by specifying only a Gitea API URL. Fixes #3487 I have not added any tests for this. Signed-off-by: Sam Therapy <sam@samtherapy.net> Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What happened?
When following the documentation, publishing a release to Gitea creates a URL that Gitea cannot parse properly.
This incorrect URL will be published when pushing to a homebrew repository, where trying to install will 404.
How can we reproduce this?
https://try.gitea.io/goreleaserbugtester9000/GoreleaserTest
creates an (incorrect) publishing URL at https://try.gitea.io//goreleaserbugtester9000/GoreleaserTest/releases/tag/v0.0.4
Homebrew repo: https://try.gitea.io/goreleaserbugtester9000/homebrew/src/branch/main/GoreleaserTest.rb#L12
while
creates a (correct) publishing URL at https://try.gitea.io/goreleaserbugtester9000/GoreleaserTest/releases/tag/v0.0.5
Homebrew repo: https://try.gitea.io/goreleaserbugtester9000/homebrew/src/branch/main/TestCorrectURL.rb#L12
goreleaser version
GoReleaser Check
Search
Code of Conduct
Additional context
Related Gitea issue: go-gitea/gitea#20462
If this behaviour is intentional, I can make a PR to fix the docs.
The text was updated successfully, but these errors were encountered: