{"record":{"id":"44cbaff3a082ca80","repo":"mislav/hub","slug":"aborting-release-due-to-empty-release-title","errorCode":null,"errorMessage":"Aborting release due to empty release title","messagePattern":"Aborting release due to empty release title","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"commands/release.go","lineNumber":494,"sourceCode":"text is the title and the rest is the description.`, tagName, project))\n\n\tflagReleaseMessage := args.Flag.AllValues(\"--message\")\n\tif len(flagReleaseMessage) > 0 {\n\t\tmessageBuilder.Message = strings.Join(flagReleaseMessage, \"\\n\\n\")\n\t\tmessageBuilder.Edit = args.Flag.Bool(\"--edit\")\n\t} else if args.Flag.HasReceived(\"--file\") {\n\t\tmessageBuilder.Message, err = msgFromFile(args.Flag.Value(\"--file\"))\n\t\tutils.Check(err)\n\t\tmessageBuilder.Edit = args.Flag.Bool(\"--edit\")\n\t} else {\n\t\tmessageBuilder.Edit = true\n\t}\n\n\ttitle, body, err := messageBuilder.Extract()\n\tutils.Check(err)\n\n\tif title == \"\" {\n\t\tutils.Check(fmt.Errorf(\"Aborting release due to empty release title\"))\n\t}\n\n\tparams := &github.Release{\n\t\tTagName:         tagName,\n\t\tTargetCommitish: args.Flag.Value(\"--commitish\"),\n\t\tName:            title,\n\t\tBody:            body,\n\t\tDraft:           args.Flag.Bool(\"--draft\"),\n\t\tPrerelease:      args.Flag.Bool(\"--prerelease\"),\n\t}\n\n\tvar release *github.Release\n\n\targs.NoForward()\n\tif args.Noop {\n\t\tui.Printf(\"Would create release `%s' for %s with tag name `%s'\\n\", title, project, tagName)\n\t} else {\n\t\trelease, err = gh.CreateRelease(project, params)","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/mislav/hub/blob/5c547ed804368763064e51f3990851e267e88edd/commands/release.go#L476-L512","documentation":"createRelease extracts the title/body from the interactive editor or message input and requires a non-empty title, since a GitHub release must have a name. If the extracted title is empty, it aborts with this error rather than creating a title-less release.","triggerScenarios":"`gh release create` where `messageBuilder.Extract()` returns title == \"\" — the first line of the editor buffer was cleared, or the `--file`/message input has an empty first block.","commonSituations":"Deleting the prefilled title line in the editor before saving; a --file whose first line is blank; scripting releases with generated notes that produced an empty headline.","solutions":["Enter a title as the first line of the editor message, or pass one via the CLI title argument/flag.","Fix the --file input so its first block is a non-empty title.","If scripting, ensure generated release notes always emit a non-empty first line (title)."],"exampleFix":"// before: file passed to --file\n\"\"\n\"- fixed crash\"\n// after\n\"v1.3.0\"\n\"- fixed crash\"","handlingStrategy":"validation","validationCode":"title, body, err := messageBuilder.Extract()\nif err != nil {\n    return err\n}\nif strings.TrimSpace(title) == \"\" {\n    return errors.New(\"release requires a non-empty title (first line)\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the title line in the release editor.","Ensure generated release-note files begin with a title.","Pass the title as a CLI argument in scripts."],"tags":["release","validation","cli"],"backgroundTag":"empty-required-field","analyzedSha":"5c547ed804368763064e51f3990851e267e88edd","analyzedAt":"2026-09-01T03:34:15.525Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}