{"record":{"id":"4c2801040eee7033","repo":"AlistGo/alist","slug":"committer-email-is-required","errorCode":null,"errorMessage":"committer email is required","messagePattern":"committer email is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/github/driver.go","lineNumber":51,"sourceCode":"\tcopyMsgTmpl   *template.Template\n\tmoveMsgTmpl   *template.Template\n\tisOnBranch    bool\n\tcommitMutex   sync.Mutex\n\tpgpEntity     *openpgp.Entity\n}\n\nfunc (d *Github) Config() driver.Config {\n\treturn config\n}\n\nfunc (d *Github) GetAddition() driver.Additional {\n\treturn &d.Addition\n}\n\nfunc (d *Github) Init(ctx context.Context) error {\n\td.RootFolderPath = utils.FixAndCleanPath(d.RootFolderPath)\n\tif d.CommitterName != \"\" && d.CommitterEmail == \"\" {\n\t\treturn errors.New(\"committer email is required\")\n\t}\n\tif d.CommitterName == \"\" && d.CommitterEmail != \"\" {\n\t\treturn errors.New(\"committer name is required\")\n\t}\n\tif d.AuthorName != \"\" && d.AuthorEmail == \"\" {\n\t\treturn errors.New(\"author email is required\")\n\t}\n\tif d.AuthorName == \"\" && d.AuthorEmail != \"\" {\n\t\treturn errors.New(\"author name is required\")\n\t}\n\tvar err error\n\td.mkdirMsgTmpl, err = template.New(\"mkdirCommitMsgTemplate\").Parse(d.MkdirCommitMsg)\n\tif err != nil {\n\t\treturn err\n\t}\n\td.deleteMsgTmpl, err = template.New(\"deleteCommitMsgTemplate\").Parse(d.DeleteCommitMsg)\n\tif err != nil {\n\t\treturn err","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/github/driver.go#L33-L69","documentation":"GitHub driver Init enforces that commit metadata comes in pairs: if CommitterName is set but CommitterEmail is empty, initialization fails. Git commits require both a name and an email for the committer identity, so the driver refuses to start with a half-configured identity.","triggerScenarios":"Storage configuration where committer_name is filled and committer_email is blank. Checked at drivers/github/driver.go:51 before templates are parsed.","commonSituations":"User copies settings from a tutorial that only showed the name field; YAML/env import dropping the email; assumption that the OAuth token identity is used automatically for commits.","solutions":["Set committer_email in the storage addition (any valid email, e.g. the GitHub account email or a noreply address like user@users.noreply.github.com).","Or clear committer_name so both fields are empty and GitHub defaults are used.","Re-save the storage to re-run Init."],"exampleFix":"// before\nCommitterName: \"alice\"\nCommitterEmail: \"\"\n\n// after\nCommitterName: \"alice\"\nCommitterEmail: \"alice@users.noreply.github.com\"","handlingStrategy":"validation","validationCode":"if cfg.CommitterName != \"\" && strings.TrimSpace(cfg.CommitterEmail) == \"\" {\n    return errors.New(\"committer email is required when committer name is set\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate name/email pairs in the config form before submit.","Offer a noreply.github.com email as a sensible default.","Treat the four identity checks as one lint rule in config validation."],"tags":["github","config","validation","commit","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}