@@ -72,6 +72,7 @@ BUILD_TIMESTAMP=""
7272BUILD_TAG=" "
7373RELEASE_VERSION=" "
7474RELEASE_NOTES=" "
75+ RELEASE_NOTES_START_TAG=" "
7576RELEASE_BRANCH=" "
7677RELEASE_GCS_BUCKET=" knative-nightly/${REPO_NAME} "
7778RELEASE_DIR=" "
@@ -93,7 +94,7 @@ readonly IMAGES_REFS_FILE="${IMAGES_REFS_FILE:-$(mktemp -d)/images_refs.txt}"
9394# Convenience function to run the GitHub CLI tool `gh`.
9495# Parameters: $1..$n - arguments to gh.
9596function gh_tool() {
96- go_run github.com/cli/cli/v2/cmd/gh@v2.65 .0 " $@ "
97+ go_run github.com/cli/cli/v2/cmd/gh@v2.105 .0 " $@ "
9798}
9899
99100# Shortcut to "git push" that handles authentication.
@@ -239,12 +240,8 @@ function prepare_dot_release() {
239240 local last_build=" $( patch_version " ${last_version} " ) "
240241 RELEASE_VERSION=" ${major_minor_version} .$(( last_build + 1 )) "
241242 echo " Will create release ${RELEASE_VERSION} at commit ${release_branch_commit} "
242- # If --release-notes not used, copy from the latest release
243- if [[ -z " ${RELEASE_NOTES} " ]]; then
244- RELEASE_NOTES=" $( mktemp) "
245- gh_tool release view " ${github_tag} " --json " body" --jq ' .body' > " ${RELEASE_NOTES} "
246- echo " Release notes from ${last_version} copied to ${RELEASE_NOTES} "
247- fi
243+ # Generate notes since the previous release when publishing, unless overridden.
244+ RELEASE_NOTES_START_TAG=" ${github_tag} "
248245}
249246
250247# Setup source nightly image for a release.
@@ -761,6 +758,11 @@ function publish_to_github() {
761758 cat " ${RELEASE_NOTES} " >> " ${description} "
762759 fi
763760
761+ local notes_args=(--notes-file " ${description} " )
762+ if [[ -z " ${RELEASE_NOTES} " && -n " ${RELEASE_NOTES_START_TAG} " ]]; then
763+ notes_args=(--generate-notes --notes-start-tag " ${RELEASE_NOTES_START_TAG} " )
764+ fi
765+
764766 # Include a tag for the go module version
765767 #
766768 # v1.0.0 = v0.27.0
@@ -787,7 +789,7 @@ function publish_to_github() {
787789 gh_tool release create \
788790 " ${github_tag} " \
789791 --title " ${title} " \
790- --notes-file " ${description } " \
792+ " ${notes_args[@] } " \
791793 " ${target_branch} " \
792794 ${attachments[@]} && return 0
793795
0 commit comments