Skip to content

Commit

Permalink
feat: get GitHub API endpoints from environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Aug 3, 2024
1 parent 3f99b43 commit df16aa7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/cmd/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ func getGitHub(ctx context.Context, opts *option.Options, cfg *config.Config) (a
}, nil
}

// https://github.com/suzuki-shunsuke/github-comment/issues/1489
if cfg.GHEBaseURL == "" {
cfg.GHEBaseURL = os.Getenv("GITHUB_API_URL")
}
if cfg.GHEGraphQLEndpoint == "" {
cfg.GHEGraphQLEndpoint = os.Getenv("GITHUB_GRAPHQL_URL")
}

return github.New(ctx, &github.ParamNew{ //nolint:wrapcheck
Token: opts.Token,
GHEBaseURL: cfg.GHEBaseURL,
Expand Down

0 comments on commit df16aa7

Please sign in to comment.