Skip to content

Commit 41cf2f8

Browse files
authored
Merge pull request #6 from roderickrandolph/master
Use GITHUB_API environment variable when defined
2 parents 0cd2bd1 + 5535064 commit 41cf2f8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ func init() {
5454
githubRepo = os.Getenv("GITHUB_REPO")
5555
githubAPIEndpoint = os.Getenv("GITHUB_API")
5656

57+
if githubAPIEndpoint == "" {
58+
githubAPIEndpoint = "https://api.github.com"
59+
}
60+
5761
flag.BoolVar(&verFlag, "version", false, "-version")
5862
flag.Parse()
5963
}
@@ -113,7 +117,7 @@ Please refer to https://help.github.com/articles/creating-an-access-token-for-co
113117

114118
githubUser = userRepo[0]
115119
githubRepo = userRepo[1]
116-
githubAPIEndpoint = fmt.Sprintf("https://api.github.com/repos/%s/%s", githubUser, githubRepo)
120+
githubAPIEndpoint = fmt.Sprintf("%s/repos/%s/%s", githubAPIEndpoint, githubUser, githubRepo)
117121

118122
if debug {
119123
log.Println("Glob pattern received: ")

0 commit comments

Comments
 (0)