@@ -112,6 +112,8 @@ func (m *MetricsCollectorGithubWorkflows) getRepoList(org string) ([]*github.Rep
112
112
}
113
113
114
114
for {
115
+ m .Logger ().Debugf (`fetching repository list with page "%d"` , opts .Page )
116
+
115
117
result , response , err := githubClient .Repositories .ListByOrg (m .Context (), org , & opts )
116
118
var ghRateLimitError * github.RateLimitError
117
119
if ok := errors .As (err , & ghRateLimitError ); ok {
@@ -140,6 +142,8 @@ func (m *MetricsCollectorGithubWorkflows) getRepoWorkflows(org, repo string) ([]
140
142
opts := github.ListOptions {PerPage : 100 , Page : 1 }
141
143
142
144
for {
145
+ m .Logger ().Debugf (`fetching workflows list for repo "%s" with page "%d"` , repo , opts .Page )
146
+
143
147
result , response , err := githubClient .Actions .ListWorkflows (m .Context (), org , repo , & opts )
144
148
var ghRateLimitError * github.RateLimitError
145
149
if ok := errors .As (err , & ghRateLimitError ); ok {
@@ -209,8 +213,6 @@ func (m *MetricsCollectorGithubWorkflows) Collect(callback chan<- func()) {
209
213
}
210
214
211
215
for _ , repo := range repositories {
212
- var workflowRuns []* github.WorkflowRun
213
-
214
216
repositoryMetric .AddInfo (prometheus.Labels {
215
217
"org" : org ,
216
218
"repo" : repo .GetName (),
@@ -237,7 +239,7 @@ func (m *MetricsCollectorGithubWorkflows) Collect(callback chan<- func()) {
237
239
})
238
240
}
239
241
240
- if len (workflowRuns ) >= 1 {
242
+ if len (workflows ) >= 1 {
241
243
workflowRuns , err := m .getRepoWorkflowRuns (repo )
242
244
if err != nil {
243
245
panic (err )
0 commit comments