From 4d72d85f9f87e76ce5665141c4ef01ec5eda6e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Marti=CC=81n?= Date: Sun, 23 Aug 2020 15:01:33 +0200 Subject: [PATCH] Add more information when a user sends a review to the PR --- src/github.sh | 8 ++++++++ src/teamwork.sh | 5 +++++ 2 files changed, 13 insertions(+) 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** " }