Skip to content

Commit 57d5dd6

Browse files
author
Lukas Hybner
committed
Logging GitHub API Rate Limit
1 parent 6ac92ab commit 57d5dd6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

controllers/githubapi/runnerapi.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package githubapi
22

33
import (
44
"context"
5+
"github.com/go-logr/logr"
56
"github.com/google/go-github/v47/github"
67
"github.com/gregjones/httpcache"
78
"github.com/palantir/go-githubapp/githubapp"
@@ -57,6 +58,7 @@ func (r runnerAPI) getClient(ctx context.Context, organization string, token str
5758

5859
// Return all runners for the org
5960
func (r runnerAPI) GetRunners(ctx context.Context, organization string, repository string, token string) ([]*github.Runner, error) {
61+
logger := logr.FromContextOrDiscard(ctx)
6062
client, err := r.getClient(ctx, organization, token)
6163
if err != nil {
6264
return nil, err
@@ -78,6 +80,7 @@ func (r runnerAPI) GetRunners(ctx context.Context, organization string, reposito
7880
if err != nil {
7981
return allRunners, err
8082
}
83+
logger.Info("GerRunners GitHub Api Rate limit", "Rate", response.Rate)
8184
allRunners = append(allRunners, runners.Runners...)
8285
if response.NextPage == 0 {
8386
break

0 commit comments

Comments
 (0)