Skip to content

Commit 4f19908

Browse files
authored
merges don't generate push events, we have to look for them separately (#35)
Signed-off-by: Tom Hennen <[email protected]>
1 parent 756c548 commit 4f19908

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sourcetool/pkg/checklevel/checklevel.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
"slices"
78
"time"
89

910
"github.com/google/go-github/v68/github"
@@ -53,8 +54,9 @@ func commitPushTime(ctx context.Context, gh_client *github.Client, commit string
5354
}
5455

5556
targetRef := fmt.Sprintf("refs/heads/%s", branch)
57+
monitoredTypes := []string{"push", "force_push", "pr_merge"}
5658
for _, activity := range result {
57-
if activity.ActivityType != "push" && activity.ActivityType != "force_push" {
59+
if !slices.Contains(monitoredTypes, activity.ActivityType) {
5860
continue
5961
}
6062
if activity.After == commit && activity.Ref == targetRef {

0 commit comments

Comments
 (0)