Skip to content

Commit 204536c

Browse files
ankddevBagToad
andauthored
docs(release create): difference --generate-notes and --notes-from-tag (cli#11534)
* docs(release create): distinguish difference between '--generate-notes' and '--notes-from-tag' Signed-off-by: Andrey <andrekabatareika@gmail.com> * Clarify release notes behavior for unannotated tags Updated help text to specify that if a git tag is not annotated, the release notes will use the commit message instead of the tag annotation. --------- Signed-off-by: Andrey <andrekabatareika@gmail.com> Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
1 parent 8951259 commit 204536c

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

pkg/cmd/release/create/create.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
9494
9595
To create a release from an annotated git tag, first create one locally with
9696
git, push the tag to GitHub, then run this command.
97-
Use %[1]s--notes-from-tag%[1]s to automatically generate the release notes
98-
from the annotated git tag.
97+
Use %[1]s--notes-from-tag%[1]s to get the release notes from the annotated git tag.
98+
If the tag is not annotated, the commit message will be used instead.
9999
100+
Use %[1]s--generate-notes%[1]s to automatically generate notes using GitHub Release Notes API.
100101
When using automatically generated release notes, a release title will also be automatically
101102
generated unless a title was explicitly passed. Additional release notes can be prepended to
102103
automatically generated notes by using the %[1]s--notes%[1]s flag.
@@ -116,13 +117,13 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
116117
# Non-interactively create a release
117118
$ gh release create v1.2.3 --notes "bugfix release"
118119
119-
# Use automatically generated release notes
120+
# Use automatically generated via GitHub Release Notes API release notes
120121
$ gh release create v1.2.3 --generate-notes
121122
122123
# Use release notes from a file
123124
$ gh release create v1.2.3 -F release-notes.md
124125
125-
# Use annotated tag notes
126+
# Use tag annotation or associated commit message as notes
126127
$ gh release create v1.2.3 --notes-from-tag
127128
128129
# Don't mark the release as latest
@@ -198,11 +199,11 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
198199
cmd.Flags().StringVarP(&opts.Body, "notes", "n", "", "Release notes")
199200
cmd.Flags().StringVarP(&notesFile, "notes-file", "F", "", "Read release notes from `file` (use \"-\" to read from standard input)")
200201
cmd.Flags().StringVarP(&opts.DiscussionCategory, "discussion-category", "", "", "Start a discussion in the specified category")
201-
cmd.Flags().BoolVarP(&opts.GenerateNotes, "generate-notes", "", false, "Automatically generate title and notes for the release")
202+
cmd.Flags().BoolVarP(&opts.GenerateNotes, "generate-notes", "", false, "Automatically generate title and notes for the release via GitHub Release Notes API")
202203
cmd.Flags().StringVar(&opts.NotesStartTag, "notes-start-tag", "", "Tag to use as the starting point for generating release notes")
203204
cmdutil.NilBoolFlag(cmd, &opts.IsLatest, "latest", "", "Mark this release as \"Latest\" (default [automatic based on date and version]). --latest=false to explicitly NOT set as latest")
204205
cmd.Flags().BoolVarP(&opts.VerifyTag, "verify-tag", "", false, "Abort in case the git tag doesn't already exist in the remote repository")
205-
cmd.Flags().BoolVarP(&opts.NotesFromTag, "notes-from-tag", "", false, "Automatically generate notes from annotated tag")
206+
cmd.Flags().BoolVarP(&opts.NotesFromTag, "notes-from-tag", "", false, "Fetch notes from the tag annotation or message of commit associated with tag")
206207
cmd.Flags().BoolVar(&opts.FailOnNoCommits, "fail-on-no-commits", false, "Fail if there are no commits since the last release (no impact on the first release)")
207208

208209
_ = cmdutil.RegisterBranchCompletionFlags(f.GitClient, cmd, "target")

0 commit comments

Comments
 (0)