mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-06-14 10:37:12 +02:00
chore(runner): refactor register flow
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
@ -5,8 +5,10 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"gitea.com/gitea/act_runner/config"
|
||||
"gitea.com/gitea/act_runner/engine"
|
||||
"gitea.com/gitea/act_runner/runtime"
|
||||
|
||||
"github.com/mattn/go-isatty"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
@ -15,7 +17,7 @@ import (
|
||||
const version = "0.1"
|
||||
|
||||
// initLogging setup the global logrus logger.
|
||||
func initLogging(cfg Config) {
|
||||
func initLogging(cfg config.Config) {
|
||||
isTerm := isatty.IsTerminal(os.Stdout.Fd())
|
||||
log.SetFormatter(&log.TextFormatter{
|
||||
DisableColors: !isTerm,
|
||||
@ -76,7 +78,7 @@ func runRoot(ctx context.Context, task *runtime.Task) func(cmd *cobra.Command, a
|
||||
}
|
||||
|
||||
task.BuildID, _ = strconv.ParseInt(jobID, 10, 64)
|
||||
task.Run(ctx, nil)
|
||||
_ = task.Run(ctx, nil)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user