1
0
forked from JOJ/JOJ3

feat(healthcheck): better check commit author email message

This commit is contained in:
张泊明518370910136 2025-06-04 06:29:58 -04:00
parent 9e8bbc5cc1
commit 47ef28516b
Signed by untrusted user: 张泊明518370910136
GPG Key ID: D47306D7062CDA9D

View File

@ -100,9 +100,15 @@ func AuthorEmailCheck(root string, allowedDomains []string) error {
return nil
}
}
return fmt.Errorf(
"Author email %s is not in the allowed domains: %v",
return fmt.Errorf("Author email %s is not in the allowed domains: `%s`\n\n"+
"To fix it, please run the following commands:\n"+
"```bash\n"+
"git config user.email \"<your_email>\"\n"+
"git commit --amend --no-edit --reset-author\n"+
"git push --force\n"+
"```\n"+
"Replace `<your_email>` with your actual email address\n",
email,
allowedDomains,
strings.Join(allowedDomains, "`, `"),
)
}