Skip to content

Commit 089b348

Browse files
Return error for authorized_keys and mergebase problems (#10990)
Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent 3d63caa commit 089b348

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/doctor.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ func runDoctorAuthorizedKeys(ctx *cli.Context) ([]string, error) {
353353
if ctx.Bool("fix") {
354354
return []string{"authorized_keys is out of date, attempting regeneration"}, models.RewriteAllPublicKeys()
355355
}
356-
return []string{"authorized_keys is out of date and should be regenerated with gitea admin regenerate keys"}, nil
356+
return nil, fmt.Errorf(`authorized_keys is out of date and should be regenerated with "gitea admin regenerate keys" or "gitea doctor --run authorized_keys --fix"`)
357357
}
358358
return nil, nil
359359
}
@@ -479,6 +479,9 @@ func runDoctorPRMergeBase(ctx *cli.Context) ([]string, error) {
479479
if ctx.Bool("fix") {
480480
results = append(results, fmt.Sprintf("%d PR mergebases updated of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos))
481481
} else {
482+
if numPRsUpdated > 0 && err == nil {
483+
return results, fmt.Errorf("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
484+
}
482485
results = append(results, fmt.Sprintf("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos))
483486
}
484487

0 commit comments

Comments
 (0)