Skip to content

Commit 0c5dda3

Browse files
Update the comment when a user approves the PR
1 parent ab70fc1 commit 0c5dda3

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/teamwork.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,16 @@ teamwork::pull_request_review_submitted() {
6161
local -r review_state=$(github::get_review_state)
6262
local -r comment=$(github::get_review_comment)
6363

64-
teamwork::add_comment "
65-
**$user** submitted a review to the PR: **$pr_title**
66-
[$pr_url]($pr_url)
67-
---
68-
Review: **$review_state**
69-
Comment: **$comment**
70-
"
64+
# Only add a message if the PR has been approved
65+
if [ "$review_state" == "approved" ]; then
66+
teamwork::add_comment "
67+
**$user** submitted a review to the PR: **$pr_title**
68+
[$pr_url]($pr_url)
69+
---
70+
Review: **$review_state**
71+
$comment
72+
"
73+
fi
7174
}
7275

7376
teamwork::pull_request_review_dismissed() {

0 commit comments

Comments
 (0)