fix: tighten config and update error handling

This commit is contained in:
2026-05-13 17:03:20 +08:00
parent 9af18f400c
commit 142c611fcb
4 changed files with 49 additions and 4 deletions

View File

@@ -67,6 +67,9 @@ func Validate(cfg domain.Config) error {
if strings.TrimSpace(cfg.Gitea.Org) == "" {
return errors.New("gitea org is required")
}
if strings.TrimSpace(cfg.Gitea.Username) == "" {
return errors.New("gitea username is required")
}
if cfg.Gitea.AuthType != AuthPassword && cfg.Gitea.AuthType != AuthToken {
return errors.New("authType must be password or token")
}