Skip to content

Commit e6b4b1f

Browse files
authored
[CI] Add Cherry-Pick PR check logic (#5191)
1 parent eae34a4 commit e6b4b1f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/check_approval.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ if [ "${HAS_SPECULATIVE_DECODING_MODIFY}" != "" ] && [ "${PR_ID}" != "" ]; then
7575
check_approval "$echo_line1" 1 freeliuzc Deleter-D
7676
fi
7777

78+
if [[ "${BRANCH}" != "develop" ]] && [[ -n "${PR_ID}" ]]; then
79+
pr_info=$(curl -H "Authorization: token ${GITHUB_TOKEN}" \
80+
https://api.github.com/repos/PaddlePaddle/FastDeploy/pulls/${PR_ID})
81+
82+
pr_title=$(echo "$pr_info" | jq -r '.title')
83+
echo "==> PR title: ${pr_title}"
84+
85+
has_cp_tag=$(echo "$pr_title" | grep -o "\[Cherry-Pick\]" || true)
86+
has_pr_number=$(echo "$pr_title" | grep -oE "#[0-9]{2,6}" || true)
87+
88+
if [[ -z "$has_cp_tag" ]] || [[ -z "$has_pr_number" ]]; then
89+
echo_line="Cherry-Pick PR must come from develop and the title must contain [Cherry-Pick] and the original develop PR number (e.g., #5010). Approval required from FastDeploy RD: qingqing01(dangqingqing), Jiang-Jia-Jun(jiangjiajun), heavengate(dengkaipeng)."
90+
check_approval "$echo_line" 1 qingqing01 Jiang-Jia-Jun heavengate
91+
fi
92+
fi
93+
7894
if [ -n "${echo_list}" ];then
7995
echo "****************"
8096
echo -e "${echo_list[@]}"

0 commit comments

Comments
 (0)