Skip to content

Commit

Permalink
Add correct URLs for base and upload URLs for enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap authored and fwiedmann committed Mar 8, 2021
1 parent 3bc68d9 commit 382cb54
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/releaser/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ func New(c *config.GitHubProvider, checkConfig bool) (*Client, error) {
if c.CustomURL == "" {
client = github.NewClient(httpClient)
} else {
if client, err = github.NewEnterpriseClient(c.CustomURL, c.CustomURL+"/api/v3/", httpClient); err != nil {
// v25.0 of google github does not append prefixes for base and upload URLs
if client, err = github.NewEnterpriseClient(c.CustomURL+"/api/v3", c.CustomURL+"/api/uploads/", httpClient); err != nil {
return &Client{}, err
}
baseURL = c.CustomURL
// NewEnterpriseClient(newest versions) adds prefix /api/v3 to base URL and /api/uploads to upload URL
// So save the new base url here
baseURL = client.BaseURL.String()
}
return &Client{
config: c,
Expand Down Expand Up @@ -91,7 +94,7 @@ func (g *Client) CreateRelease(releaseVersion *shared.ReleaseVersion, generatedC
func (g *Client) makeRelease(releaseVersion *shared.ReleaseVersion, generatedChangelog *shared.GeneratedChangelog) error {

tagPrefix := config.DefaultTagPrefix
if g.config.TagPrefix != nil{
if g.config.TagPrefix != nil {
tagPrefix = *g.config.TagPrefix
}
tag := tagPrefix + releaseVersion.Next.Version.String()
Expand Down

0 comments on commit 382cb54

Please sign in to comment.