Skip to content

Commit 4d72d85

Browse files
Add more information when a user sends a review to the PR
1 parent 5808c97 commit 4d72d85

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/github.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ github::get_sender_user() {
3232
jq --raw-output .sender.login "$GITHUB_EVENT_PATH"
3333
}
3434

35+
github::get_review_state() {
36+
jq --raw-output .review.state "$GITHUB_EVENT_PATH"
37+
}
38+
39+
github::get_review_comment() {
40+
jq --raw-output .review.body "$GITHUB_EVENT_PATH"
41+
}
42+
3543
github::print_all_data() {
3644
cat "$GITHUB_EVENT_PATH"
3745
}

src/teamwork.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,15 @@ teamwork::pull_request_review_submitted() {
5858
local -r user=$(github::get_sender_user)
5959
local -r pr_url=$(github::get_pr_url)
6060
local -r pr_title=$(github::get_pr_title)
61+
local -r review_state=$(github::get_review_state)
62+
local -r comment=$(github::get_review_comment)
6163

6264
teamwork::add_comment "
6365
**$user** submited a review to the PR: **$pr_title**
6466
[$pr_url]($pr_url)
67+
---
68+
Review: **$review_state**
69+
Comment: **$comment**
6570
"
6671
}
6772

0 commit comments

Comments
 (0)