change check shell

This commit is contained in:
barnettZQG 2020-11-30 19:40:31 +08:00
parent eef6b2b702
commit bc597aaa35

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh
sudo apt-get update && sudo apt-get install -y jq || exit 1
pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
URL="https://api.github.com/repos/goodrain/rainbond/pulls/${pull_number}/files" URL="https://api.github.com/repos/goodrain/rainbond/pulls/${pull_number}/files"
@ -9,5 +7,8 @@ URL="https://api.github.com/repos/goodrain/rainbond/pulls/${pull_number}/files"
# 这里用 jq 过滤了部分文件 # 这里用 jq 过滤了部分文件
CHANGED_MARKDOWN_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | select(.status != "removed") | select(.filename | endswith(".go")) | .filename') CHANGED_MARKDOWN_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | select(.status != "removed") | select(.filename | endswith(".go")) | .filename')
for file in ${CHANGED_MARKDOWN_FILES}; do for file in ${CHANGED_MARKDOWN_FILES}; do
echo "golint ${file}"
golint -set_exit_status=true ${file} || exit 1 golint -set_exit_status=true ${file} || exit 1
done done
echo "code golint check success"