diff --git a/src/github.sh b/src/github.sh index bbc8899b..b2109874 100644 --- a/src/github.sh +++ b/src/github.sh @@ -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" } diff --git a/src/teamwork.sh b/src/teamwork.sh index 8e5db7fb..f3a7060a 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -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** " }