Skip to content

Commit 39af2d3

Browse files
feat: get GitHub API endpoints from environment variables (#1490)
1 parent cd57418 commit 39af2d3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/cmd/post.go

+8
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ func getGitHub(ctx context.Context, opts *option.Options, cfg *config.Config) (a
5858
}, nil
5959
}
6060

61+
// https://github.com/suzuki-shunsuke/github-comment/issues/1489
62+
if cfg.GHEBaseURL == "" {
63+
cfg.GHEBaseURL = os.Getenv("GITHUB_API_URL")
64+
}
65+
if cfg.GHEGraphQLEndpoint == "" {
66+
cfg.GHEGraphQLEndpoint = os.Getenv("GITHUB_GRAPHQL_URL")
67+
}
68+
6169
return github.New(ctx, &github.ParamNew{ //nolint:wrapcheck
6270
Token: opts.Token,
6371
GHEBaseURL: cfg.GHEBaseURL,

0 commit comments

Comments
 (0)