Skip to content

Commit c6a9a2b

Browse files
never112CarlJi
authored andcommitted
fix: re run all check
1 parent c0ebeab commit c6a9a2b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

server.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
127127
log.Errorf("process check run request event: %v", err)
128128
}
129129
}()
130+
case *github.CheckSuiteEvent:
131+
go func() {
132+
if err := s.processCheckSuiteEvent(ctx, event); err != nil {
133+
log.Errorf("process check run request event: %v", err)
134+
}
135+
}()
130136
default:
131137
log.Debugf("skipping event type %s\n", github.WebHookType(r))
132138
}
@@ -153,6 +159,18 @@ func (s *Server) processCheckRunRequestEvent(ctx context.Context, event *github.
153159
return s.handle(ctx, &pevent)
154160
}
155161

162+
func (s *Server) processCheckSuiteEvent(ctx context.Context, event *github.CheckSuiteEvent) error {
163+
if event.GetAction() != "rerequested" {
164+
log.Debugf("skipping action %s\n", event.GetAction())
165+
return nil
166+
}
167+
pevent := github.PullRequestEvent{}
168+
pevent.Repo = event.GetRepo()
169+
pevent.PullRequest = event.GetCheckSuite().PullRequests[0]
170+
pevent.Installation = event.GetInstallation()
171+
return s.handle(ctx, &pevent)
172+
}
173+
156174
func (s *Server) handle(ctx context.Context, event *github.PullRequestEvent) error {
157175
var (
158176
num = event.GetPullRequest().GetNumber()

0 commit comments

Comments
 (0)