Skip to content

Commit df16aa7

Browse files
feat: get GitHub API endpoints from environment variables
1 parent 3f99b43 commit df16aa7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: 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)