From 0c5dda364638283000648661114a34e53f7a73c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Marti=CC=81n?= Date: Fri, 4 Sep 2020 15:21:59 +0200 Subject: [PATCH] Update the comment when a user approves the PR --- src/teamwork.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/teamwork.sh b/src/teamwork.sh index 3cfe79a7..a581f0d0 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -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() {