From 609c0a0773c721e9e90dd76bd3742d9178f8830d Mon Sep 17 00:00:00 2001 From: a1012112796 <1012112796@qq.com> Date: Sat, 6 May 2023 11:27:08 +0800 Subject: [PATCH] fix `--event` option logic for `exec` (#175) - fix `--event` option logic - by the way, apply a `TODO` logic Reviewed-on: https://gitea.com/gitea/act_runner/pulls/175 Reviewed-by: Lunny Xiao Co-authored-by: a1012112796 <1012112796@qq.com> Co-committed-by: a1012112796 <1012112796@qq.com> --- internal/app/cmd/exec.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/app/cmd/exec.go b/internal/app/cmd/exec.go index 4cf374b..dbe3afa 100644 --- a/internal/app/cmd/exec.go +++ b/internal/app/cmd/exec.go @@ -313,7 +313,7 @@ func runExec(ctx context.Context, execArgs *executeArgs) func(cmd *cobra.Command if len(execArgs.event) > 0 { log.Infof("Using chosed event for filtering: %s", execArgs.event) - eventName = args[0] + eventName = execArgs.event } else if len(events) == 1 && len(events[0]) > 0 { log.Infof("Using the only detected workflow event: %s", events[0]) eventName = events[0] @@ -391,12 +391,10 @@ func runExec(ctx context.Context, execArgs *executeArgs) func(cmd *cobra.Command }, } - // TODO: handle log level config - // waiting https://gitea.com/gitea/act/pulls/19 - // if !execArgs.debug { - // logLevel := log.Level(log.InfoLevel) - // config.JobLoggerLevel = &logLevel - // } + if !execArgs.debug { + logLevel := log.Level(log.InfoLevel) + config.JobLoggerLevel = &logLevel + } r, err := runner.New(config) if err != nil {