@@ -152,24 +152,28 @@ func notify(ctx context.Context, input *notifyInput) error {
152152 workflows , schedules , err := actions_module .DetectWorkflows (gitRepo , commit ,
153153 input .Event ,
154154 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 ,
156156 )
157157 if err != nil {
158158 return fmt .Errorf ("DetectWorkflows: %w" , err )
159159 }
160160
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+ )
169168
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 )
173177 }
174178 }
175179
0 commit comments