mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-07 13:31:37 +02:00
parent
c57cdab0c6
commit
86beb584bf
@ -36,7 +36,7 @@ func getInstanceURL(ctx *context.Context) (string, error) {
|
||||
u.Path = ""
|
||||
rawurl := u.String()
|
||||
if rawurl == "" {
|
||||
return "", fmt.Errorf("invalid URL: %v", apiURL)
|
||||
return "", fmt.Errorf("invalid URL: %q", ctx.Config.GiteaURLs.API)
|
||||
}
|
||||
return rawurl, nil
|
||||
}
|
||||
|
@ -625,3 +625,14 @@ func TestGiteaChangelog(t *testing.T) {
|
||||
_, err = client.Changelog(ctx, repo, "v1.0.0", "v1.1.0")
|
||||
require.EqualError(t, err, ErrNotImplemented.Error())
|
||||
}
|
||||
|
||||
func TestGetInstanceURL(t *testing.T) {
|
||||
ctx := testctx.NewWithCfg(config.Project{
|
||||
GiteaURLs: config.GiteaURLs{
|
||||
API: "http://our.internal.gitea.media/api/v1",
|
||||
},
|
||||
})
|
||||
url, err := getInstanceURL(ctx)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "http://our.internal.gitea.media", url)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user