Reject an empty pr edit title Gitea would ignore
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline failed

This commit is contained in:
2026-09-19 12:38:12 +10:00
parent 7bc4082cb0
commit 78d83b7a61
4 changed files with 30 additions and 7 deletions
+5
View File
@@ -163,6 +163,11 @@ func newPREditCmd() *cobra.Command {
// leave the title as it is, not blank it.
var opts agent.EditPROptions
if cmd.Flags().Changed("title") {
// Gitea ignores an empty title, so sending one would report
// success while changing nothing.
if title == "" {
return fmt.Errorf("--title cannot be empty: a title can be set but not cleared")
}
opts.Title = &title
}
if cmd.Flags().Changed("body") {