Skip to content

Commit 619b005

Browse files
authored
Merge pull request kubernetes#126925 from mbobrovskyi/feature/add-release-note-on-cherry-pick
Add release notes to the body of the pull request on create cherry-pick.
2 parents 9682c62 + 4ec1080 commit 619b005

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hack/cherry_pick_pull.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ function return_to_kansas {
133133
trap return_to_kansas EXIT
134134

135135
SUBJECTS=()
136+
RELEASE_NOTES=()
136137
function make-a-pr() {
137138
local rel
138139
rel="$(basename "${BRANCH}")"
@@ -149,7 +150,7 @@ ${numandtitle}
149150
For details on the cherry pick process, see the [cherry pick requests](https://git.k8s.io/community/contributors/devel/sig-release/cherry-picks.md) page.
150151
151152
\`\`\`release-note
152-
153+
$(printf '%s\n' "${RELEASE_NOTES[@]}")
153154
\`\`\`
154155
EOF
155156
)
@@ -195,9 +196,13 @@ for pull in "${PULLS[@]}"; do
195196
}
196197

197198
# set the subject
198-
subject=$(grep -m 1 "^Subject" "/tmp/${pull}.patch" | sed -e 's/Subject: \[PATCH//g' | sed 's/.*] //')
199+
subject=$(gh pr view "$pull" --json title --jq '.["title"]')
199200
SUBJECTS+=("#${pull}: ${subject}")
200201

202+
# set the release note
203+
release_note=$(gh pr view "$pull" --json body --jq '.["body"]' | awk '/```release-note/{f=1;next} /```/{f=0} f')
204+
RELEASE_NOTES+=("${release_note}")
205+
201206
# remove the patch file from /tmp
202207
rm -f "/tmp/${pull}.patch"
203208
done

0 commit comments

Comments
 (0)