Skip to content

Commit 938b9f2

Browse files
Merge branch 'main' into feature/protected-branches
2 parents 650fe0a + b506c6f commit 938b9f2

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

checks/active.go

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,7 @@ import (
2424
var lookbackDays int = 90
2525

2626
func init() {
27-
registerCheck("Active", IsActive)
28-
}
29-
30-
func IsActive(c checker.Checker) checker.CheckResult {
31-
return checker.MultiCheck(
32-
PeriodicCommits,
33-
PeriodicReleases,
34-
)(c)
27+
registerCheck("Active", PeriodicCommits)
3528
}
3629

3730
func PeriodicCommits(c checker.Checker) checker.CheckResult {
@@ -55,27 +48,6 @@ func PeriodicCommits(c checker.Checker) checker.CheckResult {
5548
c.Logf("commits in last %d days: %d", lookbackDays, totalCommits)
5649
return checker.CheckResult{
5750
Pass: totalCommits >= 2,
58-
Confidence: 7,
59-
}
60-
}
61-
62-
func PeriodicReleases(c checker.Checker) checker.CheckResult {
63-
releases, _, err := c.Client.Repositories.ListReleases(c.Ctx, c.Owner, c.Repo, &github.ListOptions{})
64-
if err != nil {
65-
return checker.RetryResult(err)
66-
}
67-
68-
tz, _ := time.LoadLocation("UTC")
69-
threshold := time.Now().In(tz).AddDate(0, 0, -1*lookbackDays)
70-
totalReleases := 0
71-
for _, r := range releases {
72-
if r.GetCreatedAt().After(threshold) {
73-
totalReleases++
74-
}
75-
}
76-
c.Logf("releases in last %d days: %d", lookbackDays, totalReleases)
77-
return checker.CheckResult{
78-
Pass: totalReleases > 0,
7951
Confidence: 10,
8052
}
8153
}

0 commit comments

Comments
 (0)