diff --git a/hack/cherry_pick_pull.sh b/hack/cherry_pick_pull.sh index 3949cfffa0..ccf41595f7 100755 --- a/hack/cherry_pick_pull.sh +++ b/hack/cherry_pick_pull.sh @@ -133,6 +133,7 @@ function return_to_kansas { trap return_to_kansas EXIT SUBJECTS=() +RELEASE_NOTES=() function make-a-pr() { local rel rel="$(basename "${BRANCH}")" @@ -143,9 +144,13 @@ function make-a-pr() { numandtitle=$(printf '%s\n' "${SUBJECTS[@]}") prtext=$(cat <&2 @@ -191,9 +196,13 @@ for pull in "${PULLS[@]}"; do } # set the subject - subject=$(grep -m 1 "^Subject" "/tmp/${pull}.patch" | sed -e 's/Subject: \[PATCH//g' | sed 's/.*] //') + subject=$(gh pr view "$pull" --json title --jq '.["title"]') SUBJECTS+=("#${pull}: ${subject}") + # set the release note + release_note=$(gh pr view "$pull" --json body --jq '.["body"]' | awk '/```release-note/{f=1;next} /```/{f=0} f') + RELEASE_NOTES+=("${release_note}") + # remove the patch file from /tmp rm -f "/tmp/${pull}.patch" done @@ -243,7 +252,7 @@ echo "+++ I'm about to do the following to push to GitHub (and I'm assuming ${FO echo echo " git push ${FORK_REMOTE} ${NEWBRANCHUNIQ}:${NEWBRANCH}" echo -read -p "+++ Proceed (anything but 'y' aborts the cherry-pick)? [y/n] " -r +read -p "+++ Proceed (anything other than 'y' aborts the cherry-pick)? [y/n] " -r if ! [[ "${REPLY}" =~ ^[yY]$ ]]; then echo "Aborting." >&2 exit 1