File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed
Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 2121
2222 - name : Generate files
2323 run : go run .
24+ env :
25+ GITHUB_API_KEY : ${{ secrets.GITHUB_TOKEN }}
2426
2527 - uses : EndBug/add-and-commit@v9
2628 with :
Original file line number Diff line number Diff line change @@ -10,4 +10,7 @@ require (
1010 github.com/shyim/go-version v0.0.0-20250828113848-97ec77491b32
1111)
1212
13- require github.com/google/go-querystring v1.1.0 // indirect
13+ require (
14+ github.com/google/go-querystring v1.1.0 // indirect
15+ golang.org/x/oauth2 v0.34.0 // indirect
16+ )
Original file line number Diff line number Diff line change @@ -9,4 +9,6 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD
99github.com/google/go-querystring v1.1.0 /go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU =
1010github.com/shyim/go-version v0.0.0-20250828113848-97ec77491b32 h1:LEMavffuqxLwefNTQYlTNj/d9yAg5zVPCKvQrtt1/l4 =
1111github.com/shyim/go-version v0.0.0-20250828113848-97ec77491b32 /go.mod h1:z47ygE4N7EC0H58FP5j5cXZtl1pSnfjwYJsHtiVtcwU =
12+ golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw =
13+ golang.org/x/oauth2 v0.34.0 /go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA =
1214golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 /go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0 =
Original file line number Diff line number Diff line change @@ -2,13 +2,25 @@ package main
22
33import (
44 "context"
5+ "os"
56
67 "github.com/google/go-github/v80/github"
8+ "golang.org/x/oauth2"
79)
810
911func main () {
1012 ctx := context .Background ()
11- client := github .NewClient (nil )
13+ var client * github.Client
14+
15+ if token := os .Getenv ("GITHUB_API_KEY" ); token != "" {
16+ ts := oauth2 .StaticTokenSource (
17+ & oauth2.Token {AccessToken : token },
18+ )
19+ tc := oauth2 .NewClient (ctx , ts )
20+ client = github .NewClient (tc )
21+ } else {
22+ client = github .NewClient (nil )
23+ }
1224
1325 tags , err := getRepositoryTags (ctx , client )
1426
You can’t perform that action at this time.
0 commit comments