Skip to content

Commit 6f799bb

Browse files
fix(scripts/release): handle cherry-pick bot titles in check commit metadata (cherry-pick #17535) (#17536)
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
1 parent 9b3c7d7 commit 6f799bb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

scripts/release/check_commit_metadata.sh

+17
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,23 @@ main() {
118118
title2=${parts2[*]:2}
119119
fi
120120

121+
# Handle cherry-pick bot, it turns "chore: foo bar (#42)" to
122+
# "chore: foo bar (cherry-pick #42) (#43)".
123+
if [[ ${title1} == *"(cherry-pick #"* ]]; then
124+
title1=${title1%" ("*}
125+
pr=${title1##*#}
126+
pr=${pr%)}
127+
title1=${title1%" ("*}
128+
title1="${title1} (#${pr})"$'\n'
129+
fi
130+
if [[ ${title2} == *"(cherry-pick #"* ]]; then
131+
title2=${title2%" ("*}
132+
pr=${title2##*#}
133+
pr=${pr%)}
134+
title2=${title2%" ("*}
135+
title2="${title2} (#${pr})"$'\n'
136+
fi
137+
121138
if [[ ${title1} != "${title2}" ]]; then
122139
log "Invariant failed, cherry-picked commits have different titles: \"${title1%$'\n'}\" != \"${title2%$'\n'}\", attempting to check commit body for cherry-pick information..."
123140

0 commit comments

Comments
 (0)