Skip to content

Commit

Permalink
Adding PR approval to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
amcdevitt-newforma committed Sep 10, 2019
1 parent 053f1fc commit e455c5d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pull-request.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ create_pull_request() {

curl -sSL -H "${AUTH_HEADER}" -H "${HEADER}" -X POST --data "${LABELS}" ${LABELS_URL}

# Approve the PR
PR_REVIEW_URL="${PULLS_URL}/${PR_NUMBER}/reviews"
echo "Approving PR: ${PR_REVIEW_URL}"
PR_REVIEW_DATA="{\"event\":\"APPROVE\"}"
RESPONSE=$(curl -sSL -H "${AUTH_HEADER}" -H "${HEADER}" -X POST --data "${PR_REVIEW_DATA}" ${PR_REVIEW_URL})
echo "PR Approval Response: ${RESPONSE}"

# Merge the PR
PULLS_MERGE_URL="${PULLS_URL}/${PR_NUMBER}/merge"
echo "Merging PR ${PR_NUMBER}: ${PULLS_MERGE_URL}"
Expand Down

0 comments on commit e455c5d

Please sign in to comment.