diff options
author | a1012112796 <1012112796@qq.com> | 2023-08-14 17:14:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-14 17:14:30 +0200 |
commit | 19872063a3c14256a1d89b2a104d63e7538a3a28 (patch) | |
tree | dcdfb5ffa923fb0f66d5e0b4b94f890be3e9fdf5 /services/actions | |
parent | Move dropzone progress bar to bottom to show filename when uploading (#26492) (diff) | |
download | forgejo-19872063a3c14256a1d89b2a104d63e7538a3a28.tar.xz forgejo-19872063a3c14256a1d89b2a104d63e7538a3a28.zip |
add disable workflow feature (#26413)
As title, that's simmilar with github.
![image](https://github.com/go-gitea/gitea/assets/25342410/9e8b2444-63e0-4e87-80da-730c1e4d09d6)
![image](https://github.com/go-gitea/gitea/assets/25342410/6c3a3345-3ba7-48c9-9acd-3e621632491b)
---------
Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Jason Song <i@wolfogre.com>
Diffstat (limited to 'services/actions')
-rw-r--r-- | services/actions/notifier_helper.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/actions/notifier_helper.go b/services/actions/notifier_helper.go index 0cc2d17f4e..75c99ff19c 100644 --- a/services/actions/notifier_helper.go +++ b/services/actions/notifier_helper.go @@ -150,7 +150,14 @@ func notify(ctx context.Context, input *notifyInput) error { if len(workflows) == 0 { log.Trace("repo %s with commit %s couldn't find workflows", input.Repo.RepoPath(), commit.ID) } else { + actionsConfig := input.Repo.MustGetUnit(ctx, unit_model.TypeActions).ActionsConfig() + for _, wf := range workflows { + if actionsConfig.IsWorkflowDisabled(wf.EntryName) { + log.Trace("repo %s has disable workflows %s", input.Repo.RepoPath(), wf.EntryName) + continue + } + if wf.TriggerEvent != actions_module.GithubEventPullRequestTarget { detectedWorkflows = append(detectedWorkflows, wf) } |