File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,17 @@ func (m *MetricsCollectorGithubWorkflows) Collect(callback chan<- func()) {
253
253
}
254
254
255
255
for _ , repo := range repositories {
256
+ // skip archived or disabled repos
257
+ if repo .GetArchived () || repo .GetDisabled () {
258
+ continue
259
+ }
260
+
261
+ // skip repos without default branch (not setup yet?)
262
+ if repo .GetDefaultBranch () == "" {
263
+ // repo doesn't have default branch
264
+ continue
265
+ }
266
+
256
267
// build custom properties
257
268
propLabels := prometheus.Labels {}
258
269
if len (Opts .GitHub .Repositories .CustomProperties ) >= 1 {
@@ -277,11 +288,7 @@ func (m *MetricsCollectorGithubWorkflows) Collect(callback chan<- func()) {
277
288
}
278
289
repositoryMetric .AddInfo (labels )
279
290
280
- if repo .GetDefaultBranch () == "" {
281
- // repo doesn't have default branch
282
- continue
283
- }
284
-
291
+ // get workflows
285
292
workflows , err := m .getRepoWorkflows (org , repo .GetName ())
286
293
if err != nil {
287
294
panic (err )
You can’t perform that action at this time.
0 commit comments