mislav/hub · error

Aborting editing due to empty release title

Error message

Aborting editing due to empty release title

What it means

editRelease extracts the new title/body from the editor or message input; the title check is skipped only when `--notes`-style messages (flagReleaseMessage) are supplied, since then the name is intentionally left untouched. If the extracted title is empty and no release message flags were given, editing aborts to avoid blanking the release name.

Source

Thrown at commands/release.go:606

	flagReleaseMessage := args.Flag.AllValues("--message")
	if len(flagReleaseMessage) > 0 {
		messageBuilder.Message = strings.Join(flagReleaseMessage, "\n\n")
		messageBuilder.Edit = args.Flag.Bool("--edit")
	} else if args.Flag.HasReceived("--file") {
		messageBuilder.Message, err = msgFromFile(args.Flag.Value("--file"))
		utils.Check(err)
		messageBuilder.Edit = args.Flag.Bool("--edit")
	} else {
		messageBuilder.Edit = true
		messageBuilder.Message = strings.Replace(fmt.Sprintf("%s\n\n%s", release.Name, release.Body), "\r\n", "\n", -1)
	}

	title, body, err := messageBuilder.Extract()
	utils.Check(err)

	if title == "" && len(flagReleaseMessage) == 0 {
		utils.Check(fmt.Errorf("Aborting editing due to empty release title"))
	}

	if title != "" {
		params["name"] = title
	}
	if body != "" {
		params["body"] = body
	}

	args.NoForward()
	if len(params) > 0 {
		if args.Noop {
			ui.Printf("Would edit release `%s'\n", tagName)
		} else {
			release, err = gh.EditRelease(release, params)
			utils.Check(err)
		}

View on GitHub (pinned to 5c547ed804)

Solutions

  1. Keep/provide a title (first line of the editor message or the CLI title argument).
  2. Pass explicit release message flags (e.g. --notes) so only the body changes and the title is preserved.
  3. Fix the --file input to include a non-empty first line if a title change is intended.

Example fix

// before
gh release edit v1.0.0   # cleared the title in the editor
// after
gh release edit v1.0.0 --notes "Updated release notes"  # title preserved
Defensive patterns

Strategy: validation

Validate before calling

title, _, err := messageBuilder.Extract()
if err != nil {
    return err
}
if strings.TrimSpace(title) == "" && len(flagReleaseMessage) == 0 {
    return errors.New("provide a title or --notes to edit a release")
}

Prevention

When it happens

Trigger: `gh release edit` where `messageBuilder.Extract()` yields title == "" and len(flagReleaseMessage) == 0 — the title line was emptied in the editor and no --notes/--message-style flags were provided.

Common situations: Clearing the prefilled title while only intending to edit the notes; passing an empty --file; forgetting that editing requires either a title or explicit message flags.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of mislav/hub@5c547ed804 (2026-09-01). Data as JSON: /api/errors/383f90f6d79be26b. Report an issue: GitHub.