Skip to content

Commit

Permalink
Remove unused function and clean up final message
Browse files Browse the repository at this point in the history
  • Loading branch information
dereksmart authored Apr 17, 2020
1 parent 31b5777 commit cc753b4
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ state=$(jq --raw-output .review.state "$GITHUB_EVENT_PATH")
number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
sha=$(jq --raw-output .pull_request.head.sha "$GITHUB_EVENT_PATH")

containsElement () {
local e match="$1"
shift
for e; do [[ "$e" == "$match" ]] && return 0; done
return 1
}

check_for_required_review () {
body=$(curl -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}/pulls/${number}/reviews?per_page=100")
reviews=$(echo "$body" | jq --raw-output '.[] | @base64')
Expand Down Expand Up @@ -89,13 +82,8 @@ check_for_required_review () {
-d "{\"state\":\"${status}\", \"target_url\":\"https://github.com/Automattic/jetpack/pull/${number}/commits/${sha}\", \"description\":\"${description}\", \"context\":\"${STATUS_CONTEXT}\" }" \
"${URI}/repos/${GITHUB_REPOSITORY}/statuses/${sha}"

if [ "$status" == "success" ]; then
echo "PR approved required review!"
exit 0
else
echo "Still pending required review."
# Intentionally no status exit.
fi
echo "$status"
echo "$description"
}

check_for_required_review

0 comments on commit cc753b4

Please sign in to comment.