Merge pull request 'Fix duplicated log when register failed' (#3) from lunny/act_runner:lunny/fix_register_failure_hint into main
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/3
This commit is contained in:
commit
715d0e85ce
|
@ -252,7 +252,7 @@ func registerNoInteractive(envFile string, regArgs *registerArgs) error {
|
||||||
}
|
}
|
||||||
if err := doRegister(&cfg, inputs); err != nil {
|
if err := doRegister(&cfg, inputs); err != nil {
|
||||||
log.Errorf("Failed to register runner: %v", err)
|
log.Errorf("Failed to register runner: %v", err)
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
log.Infof("Runner registered successfully.")
|
log.Infof("Runner registered successfully.")
|
||||||
return nil
|
return nil
|
||||||
|
@ -296,10 +296,5 @@ func doRegister(cfg *config.Config, inputs *registerInputs) error {
|
||||||
cfg.Runner.Token = inputs.Token
|
cfg.Runner.Token = inputs.Token
|
||||||
cfg.Runner.Labels = inputs.CustomLabels
|
cfg.Runner.Labels = inputs.CustomLabels
|
||||||
_, err := register.New(cli).Register(ctx, cfg.Runner)
|
_, err := register.New(cli).Register(ctx, cfg.Runner)
|
||||||
if err != nil {
|
return err
|
||||||
log.WithError(err).Errorln("Cannot register the runner")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue