File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ function return_to_kansas {
134134trap return_to_kansas EXIT
135135
136136SUBJECTS=()
137+ RELEASE_NOTES=()
137138function make-a-pr() {
138139 local rel
139140 rel=" $( basename " ${BRANCH} " ) "
@@ -142,12 +143,17 @@ function make-a-pr() {
142143
143144 local numandtitle
144145 numandtitle=$( printf ' %s\n' " ${SUBJECTS[@]} " )
146+ local release_notes
147+ if (( ${# RELEASE_NOTES[@]} > 0 )) ; then
148+ release_notes=$( printf ' %s\n' " ${RELEASE_NOTES[@]} " )
149+ fi
145150 prtext=$(
146151 cat << EOF
147152Cherry pick of ${PULLSUBJ} on ${rel} .
148153${numandtitle}
149154For details on the cherry pick process, see the [cherry pick requests](https://karmada.io/docs/contributor/cherry-picks) page.
150155\`\`\` release-note
156+ ${release_notes}
151157\`\`\`
152158EOF
153159 )
@@ -196,6 +202,14 @@ for pull in "${PULLS[@]}"; do
196202 subject=$( grep -m 1 " ^Subject" " /tmp/${pull} .patch" | sed -e ' s/Subject: \[PATCH//g' | sed ' s/.*] //' )
197203 SUBJECTS+=(" #${pull} : ${subject} " )
198204
205+ # get release note
206+ echo " +++ Getting release note from PR ${pull} "
207+ pr_body=$( gh pr view " ${pull} " --json body --repo " ${MAIN_REPO_ORG} /${MAIN_REPO_NAME} " -q ' .body' )
208+ release_note=$( echo " ${pr_body} " | sed -n ' /```release-note/,/```/p' | sed ' /^```/d' | awk ' NF' )
209+ if [[ -n " ${release_note} " && " ${release_note} " != " NONE" ]]; then
210+ RELEASE_NOTES+=(" ${release_note} " )
211+ fi
212+
199213 # remove the patch file from /tmp
200214 rm -f " /tmp/${pull} .patch"
201215done
You can’t perform that action at this time.
0 commit comments