checkapproval.sh 1017 字节
Newer Older
T
tianshuo78520a 已提交
1 2 3 4
#!/bin/bash

API_FILES=("doc/fluid")
for API_FILE in ${API_FILES[*]}; do
T
tianshuo78520a 已提交
5
  API_CHANGE=`git diff --name-only upstream/$BRANCH | grep "${API_FILE}" | grep -v "doc/fluid/design/mkldnn" || true`
T
tianshuo78520a 已提交
6 7 8
  if [ "${API_CHANGE}" ];then
    approval_line=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/FluidDoc/pulls/${GIT_PR_ID}/reviews?per_page=10000`
    if [ "${API_FILE}" == "doc/fluid" ];then
T
Tao Luo 已提交
9
      APPROVALS=`echo ${approval_line}|python ./scripts/check_pr_approval.py 1 46782768 7534971 14105589 12605721 3064195 328693 47554610 39645414 11195205 20274488 45024560 ` 
T
tianshuo78520a 已提交
10 11 12 13
    fi
  fi
  if [ "${APPROVALS}" == "FALSE" ]; then
    if [ "${API_FILE}" == "doc/fluid" ];then
T
Tao Luo 已提交
14
      echo "You must have one RD (XiaoguangHu01 or wanghaoshuang or guoshengCS or heavengate or kuke or Superjomn or lanxianghit or cyj1986 or hutuxian or frankwhzhang or nepeplwu) approval for the api change! ${API_FILE} for the management reason of API interface and API document."
T
tianshuo78520a 已提交
15 16 17 18
    fi
    exit 1
  fi
done