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