未验证 提交 f1074e3b 编写于 作者: I iducn 提交者: GitHub

hide the token output to safely (#28716)

上级 32b90b1c
...@@ -727,6 +727,7 @@ function generate_api_spec() { ...@@ -727,6 +727,7 @@ function generate_api_spec() {
} }
function check_approvals_of_unittest() { function check_approvals_of_unittest() {
set +x
if [ "$GITHUB_API_TOKEN" == "" ] || [ "$GIT_PR_ID" == "" ]; then if [ "$GITHUB_API_TOKEN" == "" ] || [ "$GIT_PR_ID" == "" ]; then
return 0 return 0
fi fi
...@@ -736,7 +737,6 @@ function check_approvals_of_unittest() { ...@@ -736,7 +737,6 @@ function check_approvals_of_unittest() {
approval_line=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/${GIT_PR_ID}/reviews?per_page=10000` approval_line=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/${GIT_PR_ID}/reviews?per_page=10000`
if [ "${approval_line}" != "" ]; then if [ "${approval_line}" != "" ]; then
APPROVALS=`echo ${approval_line}|python ${PADDLE_ROOT}/tools/check_pr_approval.py 1 22165420 52485244` APPROVALS=`echo ${approval_line}|python ${PADDLE_ROOT}/tools/check_pr_approval.py 1 22165420 52485244`
set +x
echo "current pr ${GIT_PR_ID} got approvals: ${APPROVALS}" echo "current pr ${GIT_PR_ID} got approvals: ${APPROVALS}"
if [ "${APPROVALS}" == "TRUE" ]; then if [ "${APPROVALS}" == "TRUE" ]; then
echo "===================================" echo "==================================="
...@@ -750,7 +750,6 @@ function check_approvals_of_unittest() { ...@@ -750,7 +750,6 @@ function check_approvals_of_unittest() {
if [ "$unittest_spec_diff" != "" ]; then if [ "$unittest_spec_diff" != "" ]; then
approval_line=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/${GIT_PR_ID}/reviews?per_page=10000` approval_line=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/${GIT_PR_ID}/reviews?per_page=10000`
APPROVALS=`echo ${approval_line}|python ${PADDLE_ROOT}/tools/check_pr_approval.py 1 22165420 52485244 32428676 45041955` APPROVALS=`echo ${approval_line}|python ${PADDLE_ROOT}/tools/check_pr_approval.py 1 22165420 52485244 32428676 45041955`
set +x
echo "current pr ${GIT_PR_ID} got approvals: ${APPROVALS}" echo "current pr ${GIT_PR_ID} got approvals: ${APPROVALS}"
if [ "${APPROVALS}" == "FALSE" ]; then if [ "${APPROVALS}" == "FALSE" ]; then
echo "************************************" echo "************************************"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册