@@ -152,24 +152,28 @@ func notify(ctx context.Context, input *notifyInput) error {
152
152
workflows , schedules , err := actions_module .DetectWorkflows (gitRepo , commit ,
153
153
input .Event ,
154
154
input .Payload ,
155
- input .Event == webhook_module .HookEventPush && input .Ref == input .Repo .DefaultBranch ,
155
+ input .Event == webhook_module .HookEventPush && git . RefName ( input .Ref ). BranchName () == input .Repo .DefaultBranch ,
156
156
)
157
157
if err != nil {
158
158
return fmt .Errorf ("DetectWorkflows: %w" , err )
159
159
}
160
160
161
- if len (workflows ) == 0 {
162
- log .Trace ("repo %s with commit %s couldn't find workflows" , input .Repo .RepoPath (), commit .ID )
163
- } else {
164
- for _ , wf := range workflows {
165
- if actionsConfig .IsWorkflowDisabled (wf .EntryName ) {
166
- log .Trace ("repo %s has disable workflows %s" , input .Repo .RepoPath (), wf .EntryName )
167
- continue
168
- }
161
+ log .Trace ("repo %s with commit %s event %s find %d workflows and %d schedules" ,
162
+ input .Repo .RepoPath (),
163
+ commit .ID ,
164
+ input .Event ,
165
+ len (workflows ),
166
+ len (schedules ),
167
+ )
169
168
170
- if wf .TriggerEvent .Name != actions_module .GithubEventPullRequestTarget {
171
- detectedWorkflows = append (detectedWorkflows , wf )
172
- }
169
+ for _ , wf := range workflows {
170
+ if actionsConfig .IsWorkflowDisabled (wf .EntryName ) {
171
+ log .Trace ("repo %s has disable workflows %s" , input .Repo .RepoPath (), wf .EntryName )
172
+ continue
173
+ }
174
+
175
+ if wf .TriggerEvent .Name != actions_module .GithubEventPullRequestTarget {
176
+ detectedWorkflows = append (detectedWorkflows , wf )
173
177
}
174
178
}
175
179
0 commit comments