chore(cmd/joj3): log msg in summary
All checks were successful
submodules sync / sync (push) Successful in 49s
build / build (push) Successful in 1m38s
build / trigger-build-image (push) Successful in 9s

This commit is contained in:
张泊明518370910136 2024-11-21 03:16:13 -05:00
parent db2abb4bbc
commit fa5f4216dc
GPG Key ID: D47306D7062CDA9D

View File

@ -17,7 +17,6 @@ var (
confFileName string confFileName string
fallbackConfFileName string fallbackConfFileName string
tag string tag string
msg string
showVersion *bool showVersion *bool
Version string = "debug" Version string = "debug"
) )
@ -27,8 +26,6 @@ func init() {
flag.StringVar(&confFileName, "conf-name", "conf.json", "filename for config files") flag.StringVar(&confFileName, "conf-name", "conf.json", "filename for config files")
flag.StringVar(&fallbackConfFileName, "fallback-conf-name", "", "filename for the fallback config file in conf-root, leave empty to use conf-name") flag.StringVar(&fallbackConfFileName, "fallback-conf-name", "", "filename for the fallback config file in conf-root, leave empty to use conf-name")
flag.StringVar(&tag, "tag", "", "tag to trigger the running, when non-empty, should equal to the scope in msg") flag.StringVar(&tag, "tag", "", "tag to trigger the running, when non-empty, should equal to the scope in msg")
// TODO: remove this flag
flag.StringVar(&msg, "msg", "", "[DEPRECATED] will be ignored")
showVersion = flag.Bool("version", false, "print current version") showVersion = flag.Bool("version", false, "print current version")
} }
@ -37,6 +34,7 @@ func mainImpl() (err error) {
var stageResults []internalStage.StageResult var stageResults []internalStage.StageResult
var forceQuitStageName string var forceQuitStageName string
var teapotResult teapot.TeapotResult var teapotResult teapot.TeapotResult
var msg string
defer func() { defer func() {
totalScore := 0 totalScore := 0
for _, stageResult := range stageResults { for _, stageResult := range stageResults {
@ -57,6 +55,7 @@ func mainImpl() (err error) {
"issue", teapotResult.Issue, "issue", teapotResult.Issue,
"action", teapotResult.Action, "action", teapotResult.Action,
"sha", teapotResult.Sha, "sha", teapotResult.Sha,
"msg", msg,
"error", err, "error", err,
) )
}() }()
@ -73,7 +72,7 @@ func mainImpl() (err error) {
fallbackConfFileName = confFileName fallbackConfFileName = confFileName
} }
slog.Info("start joj3", "version", Version) slog.Info("start joj3", "version", Version)
msg, err := conf.GetCommitMsg() msg, err = conf.GetCommitMsg()
if err != nil { if err != nil {
slog.Error("get commit msg", "error", err) slog.Error("get commit msg", "error", err)
return err return err