Skip to content

Commit

Permalink
Add more information when a user sends a review to the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelbemartin committed Aug 23, 2020
1 parent 5808c97 commit 4d72d85
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ github::get_sender_user() {
jq --raw-output .sender.login "$GITHUB_EVENT_PATH"
}

github::get_review_state() {
jq --raw-output .review.state "$GITHUB_EVENT_PATH"
}

github::get_review_comment() {
jq --raw-output .review.body "$GITHUB_EVENT_PATH"
}

github::print_all_data() {
cat "$GITHUB_EVENT_PATH"
}
5 changes: 5 additions & 0 deletions src/teamwork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,15 @@ teamwork::pull_request_review_submitted() {
local -r user=$(github::get_sender_user)
local -r pr_url=$(github::get_pr_url)
local -r pr_title=$(github::get_pr_title)
local -r review_state=$(github::get_review_state)
local -r comment=$(github::get_review_comment)

teamwork::add_comment "
**$user** submited a review to the PR: **$pr_title**
[$pr_url]($pr_url)
---
Review: **$review_state**
Comment: **$comment**
"
}

Expand Down

0 comments on commit 4d72d85

Please sign in to comment.