Skip to content

Commit

Permalink
Merge pull request runatlantis#23 from hootsuite/anubhavmishra-patch-1
Browse files Browse the repository at this point in the history
fixing default github api url
  • Loading branch information
anubhavmishra authored Jun 12, 2017
2 parents d1bda5f + 0d296be commit 1d741cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var stringFlags = []stringFlag{
{
name: ghHostnameFlag,
description: "Hostname of Github installation.",
value: "api.github.com",
},
{
name: logLevelFlag,
Expand Down
6 changes: 5 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ func NewServer(config ServerConfig) (*Server, error) {
}
githubBaseClient := github.NewClient(tp.Client())
githubClientCtx := context.Background()
githubBaseClient.BaseURL, _ = url.Parse(fmt.Sprintf("https://%s/api/v3/", config.GitHubHostname))
ghHostname := fmt.Sprintf("https://%s/api/v3/", config.GitHubHostname)
if config.GitHubHostname == "api.github.com" {
ghHostname = fmt.Sprintf("https://%s/", config.GitHubHostname)
}
githubBaseClient.BaseURL, _ = url.Parse(ghHostname)
githubClient := &GithubClient{client: githubBaseClient, ctx: githubClientCtx}
terraformClient := &TerraformClient{
tfExecutableName: "terraform",
Expand Down

0 comments on commit 1d741cb

Please sign in to comment.