Revert "Fix schedule not trigger bug because matching full ref name with short ref name (#28874)"
This reverts commit23efd9d278
. (cherry picked from commitb263ac67e0
) (cherry picked from commit4699db575c
)
This commit is contained in:
parent
f7fd1c7c86
commit
0fd9d08ea0
1 changed files with 12 additions and 16 deletions
|
@ -160,28 +160,24 @@ func notify(ctx context.Context, input *notifyInput) error {
|
||||||
workflows, schedules, err := actions_module.DetectWorkflows(gitRepo, commit,
|
workflows, schedules, err := actions_module.DetectWorkflows(gitRepo, commit,
|
||||||
input.Event,
|
input.Event,
|
||||||
input.Payload,
|
input.Payload,
|
||||||
input.Event == webhook_module.HookEventPush && git.RefName(input.Ref).BranchName() == input.Repo.DefaultBranch,
|
input.Event == webhook_module.HookEventPush && input.Ref == input.Repo.DefaultBranch,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("DetectWorkflows: %w", err)
|
return fmt.Errorf("DetectWorkflows: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Trace("repo %s with commit %s event %s find %d workflows and %d schedules",
|
if len(workflows) == 0 {
|
||||||
input.Repo.RepoPath(),
|
log.Trace("repo %s with commit %s couldn't find workflows", input.Repo.RepoPath(), commit.ID)
|
||||||
commit.ID,
|
} else {
|
||||||
input.Event,
|
for _, wf := range workflows {
|
||||||
len(workflows),
|
if actionsConfig.IsWorkflowDisabled(wf.EntryName) {
|
||||||
len(schedules),
|
log.Trace("repo %s has disable workflows %s", input.Repo.RepoPath(), wf.EntryName)
|
||||||
)
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
for _, wf := range workflows {
|
if wf.TriggerEvent.Name != actions_module.GithubEventPullRequestTarget {
|
||||||
if actionsConfig.IsWorkflowDisabled(wf.EntryName) {
|
detectedWorkflows = append(detectedWorkflows, wf)
|
||||||
log.Trace("repo %s has disable workflows %s", input.Repo.RepoPath(), wf.EntryName)
|
}
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if wf.TriggerEvent.Name != actions_module.GithubEventPullRequestTarget {
|
|
||||||
detectedWorkflows = append(detectedWorkflows, wf)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue