Skip to content

Commit 6764809

Browse files
committed
Improve formatting of PR descriptions.
1 parent b29bf3f commit 6764809

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/backport.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,18 @@ jobs:
238238
PR_TITLE="Backport to ${MATRIX_BRANCH}"
239239
fi
240240
241-
BODY="Backport to the \`${MATRIX_BRANCH}\` branch."
241+
if [ -n "${INPUTS_COMMIT_SHA}" ]; then
242+
BODY="This pull request backports \`${INPUTS_COMMIT_SHA}\` to the \`${MATRIX_BRANCH}\` branch."
243+
else
244+
BODY="Backport to the \`${MATRIX_BRANCH}\` branch."
245+
fi
246+
242247
BODY="${BODY}\n\n## Changes\n"
243248
244249
if [ -n "${INPUTS_COMMIT_SHA}" ]; then
245250
COMMIT_MESSAGE=$(git log --format=%B -n 1 "${INPUTS_COMMIT_SHA}")
246-
BODY="${BODY}\n${COMMIT_MESSAGE}\nCherry-picked from \`${INPUTS_COMMIT_SHA}\`."
251+
BLOCKQUOTE=$(echo "${COMMIT_MESSAGE}" | sed 's/^/> /')
252+
BODY="${BODY}\n${BLOCKQUOTE}"
247253
fi
248254
249255
if [ -n "${INPUTS_PR_NUMBERS}" ] && [ -z "${INPUTS_COMMIT_SHA}" ]; then

0 commit comments

Comments
 (0)