File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ import (
1616 "golang.org/x/oauth2"
1717)
1818
19+ const githubGraphQLURL = "https://api.github.com/graphql"
20+
1921var version = "development"
2022
2123var opts struct {
@@ -52,9 +54,17 @@ func main() {
5254 log .Fatal ("GITHUB_TOKEN env var must be set" )
5355 }
5456
57+ ghes := os .Getenv ("GITHUB_GRAPHQL_URL" )
58+
5559 tok := oauth2 .StaticTokenSource (& oauth2.Token {AccessToken : ght })
5660 httpClient := oauth2 .NewClient (ctx , tok )
57- 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+ }
5868
5969 // parse the commit message into headline and body
6070 headline , body := parseMessage (opts .Message )
You can’t perform that action at this time.
0 commit comments