-
Notifications
You must be signed in to change notification settings - Fork 763
/
checkapproval.sh
27 lines (24 loc) · 1.09 KB
/
checkapproval.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
set -x
API_FILES=("docs/api/paddle")
for API_FILE in ${API_FILES[*]}; do
API_CHANGE=`git diff --name-only upstream/$BRANCH | grep "${API_FILE}"`
if [ "${API_CHANGE}" ];then
set +x
approval_line=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/docs/pulls/${GIT_PR_ID}/reviews?per_page=10000`
set -x
if [ "${API_FILE}" == "docs/api/paddle" ];then
APPROVALS=`echo ${approval_line} | python ./check_pr_approval.py 1 29231 79295425 23093488 39876205 70642955`
fi
fi
if [ "${APPROVALS}" == "FALSE" ]; then
if [ "${API_FILE}" == "docs/api/paddle" ];then
set +x
echo "=========================================================================================="
echo "You must have one TPM (jzhang533/ZhangJun or Ligoml/LiMengLiu or sunzhongkai588/SunZhongKai) approval for the api change! ${API_FILE} for the management reason of API interface and API document."
echo "=========================================================================================="
set -x
fi
exit 1
fi
done