@@ -112,6 +112,8 @@ func (m *MetricsCollectorGithubWorkflows) getRepoList(org string) ([]*github.Rep
112112}
113113
114114for {
115+ m .Logger ().Debugf (`fetching repository list with page "%d"` , opts .Page )
116+
115117result , response , err := githubClient .Repositories .ListByOrg (m .Context (), org , & opts )
116118var ghRateLimitError * github.RateLimitError
117119if ok := errors .As (err , & ghRateLimitError ); ok {
@@ -140,6 +142,8 @@ func (m *MetricsCollectorGithubWorkflows) getRepoWorkflows(org, repo string) ([]
140142opts := github.ListOptions {PerPage : 100 , Page : 1 }
141143
142144for {
145+ m .Logger ().Debugf (`fetching workflows list for repo "%s" with page "%d"` , repo , opts .Page )
146+
143147result , response , err := githubClient .Actions .ListWorkflows (m .Context (), org , repo , & opts )
144148var ghRateLimitError * github.RateLimitError
145149if ok := errors .As (err , & ghRateLimitError ); ok {
@@ -209,8 +213,6 @@ func (m *MetricsCollectorGithubWorkflows) Collect(callback chan<- func()) {
209213}
210214
211215for _ , repo := range repositories {
212- var workflowRuns []* github.WorkflowRun
213-
214216repositoryMetric .AddInfo (prometheus.Labels {
215217"org" : org ,
216218"repo" : repo .GetName (),
@@ -237,7 +239,7 @@ func (m *MetricsCollectorGithubWorkflows) Collect(callback chan<- func()) {
237239})
238240}
239241
240- if len (workflowRuns ) >= 1 {
242+ if len (workflows ) >= 1 {
241243workflowRuns , err := m .getRepoWorkflowRuns (repo )
242244if err != nil {
243245panic (err )
0 commit comments