We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e1e5b4a + 7527dc3 commit 16fdb9cCopy full SHA for 16fdb9c
1 file changed
main.go
@@ -16,6 +16,8 @@ import (
16
"golang.org/x/oauth2"
17
)
18
19
+const githubGraphQLURL = "https://api.github.com/graphql"
20
+
21
var version = "development"
22
23
var opts struct {
@@ -52,9 +54,17 @@ func main() {
52
54
log.Fatal("GITHUB_TOKEN env var must be set")
53
55
}
56
57
+ ghes := os.Getenv("GITHUB_GRAPHQL_URL")
58
59
tok := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: ght})
60
httpClient := oauth2.NewClient(ctx, tok)
- client := githubv4.NewClient(httpClient)
61
62
+ var client *githubv4.Client
63
+ if ghes == githubGraphQLURL {
64
+ client = githubv4.NewClient(httpClient)
65
+ } else {
66
+ client = githubv4.NewEnterpriseClient(ghes, httpClient)
67
+ }
68
69
// parse the commit message into headline and body
70
headline, body := parseMessage(opts.Message)
0 commit comments