Skip to content

Commit

Permalink
Update the comment when a user approves the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelbemartin committed Sep 4, 2020
1 parent ab70fc1 commit 0c5dda3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/teamwork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,16 @@ teamwork::pull_request_review_submitted() {
local -r review_state=$(github::get_review_state)
local -r comment=$(github::get_review_comment)

teamwork::add_comment "
**$user** submitted a review to the PR: **$pr_title**
[$pr_url]($pr_url)
---
Review: **$review_state**
Comment: **$comment**
"
# Only add a message if the PR has been approved
if [ "$review_state" == "approved" ]; then
teamwork::add_comment "
**$user** submitted a review to the PR: **$pr_title**
[$pr_url]($pr_url)
---
Review: **$review_state**
$comment
"
fi
}

teamwork::pull_request_review_dismissed() {
Expand Down

0 comments on commit 0c5dda3

Please sign in to comment.