From 46f5c237be9e66b3c00b0d6fcbd8c791acaf4023 Mon Sep 17 00:00:00 2001 From: Richard Lock Date: Mon, 11 Nov 2024 12:16:35 -0500 Subject: [PATCH 1/4] feat: additional modifications --- src/teamwork.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/teamwork.sh b/src/teamwork.sh index 509852dd..18521d50 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -144,6 +144,7 @@ teamwork::pull_request_opened() { local -r pr_stats=$(github::get_pr_patch_stats) local -r pr_body=$(github::get_pr_body) IFS=" " read -r -a pr_stats_array <<< "$pr_stats" +# TODO: extract actual PR comments from body, exclude Author and Reviewer checklist from PR template teamwork::add_comment " **$user** opened a PR: **[$pr_title]($pr_url)** @@ -194,7 +195,7 @@ teamwork::pull_request_review_submitted() { local -r review_state=$(github::get_review_state) local -r comment=$(github::get_review_comment) - # Message when PR has been approved + ## Message when PR has been approved if [ "$review_state" == "approved" ]; then teamwork::add_comment " **$user** submitted a review to the PR: **[$pr_title]($pr_url)** @@ -202,14 +203,16 @@ teamwork::pull_request_review_submitted() { --- Review: **$review_state ✅** -$comment +if [ -z "${VAR}" ]; then + Comment: $comment +fi " teamwork::add_tag "PR Approved" teamwork::remove_tag "PR Changes Requested" teamwork::move_task_to_column "$BOARD_COLUMN_REVIEWED" fi - # Add a message if the PR has change requested + ## Add a message if the PR has change requested if [ "$review_state" == "changes_requested" ]; then teamwork::add_comment " **$user** submitted a change request to the PR: **[$pr_title]($pr_url)** @@ -217,7 +220,9 @@ $comment --- Review: **$review_state 😔** -$comment +if [ -z "${VAR}" ]; then + Comment: $comment +fi " teamwork::add_tag "PR Changes Requested" teamwork::remove_tag "PR Approved" From dc3e80a35e19523942d6f3327ff8841da55c1599 Mon Sep 17 00:00:00 2001 From: Richard Lock Date: Mon, 11 Nov 2024 12:21:22 -0500 Subject: [PATCH 2/4] fix: bad variable --- src/teamwork.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/teamwork.sh b/src/teamwork.sh index 18521d50..5bfaac94 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -203,7 +203,7 @@ teamwork::pull_request_review_submitted() { --- Review: **$review_state ✅** -if [ -z "${VAR}" ]; then +if [ -z $comment ]; then Comment: $comment fi " @@ -220,7 +220,7 @@ fi --- Review: **$review_state 😔** -if [ -z "${VAR}" ]; then +if [ -z $comment ]; then Comment: $comment fi " From 661d5853e77ed032275dfa6e0aff7ebc5cc8837d Mon Sep 17 00:00:00 2001 From: Richard Lock Date: Mon, 11 Nov 2024 12:23:16 -0500 Subject: [PATCH 3/4] chore: comment out unused IFS --- src/teamwork.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/teamwork.sh b/src/teamwork.sh index 5bfaac94..e3c4c060 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -143,7 +143,7 @@ teamwork::pull_request_opened() { local -r user=$(github::get_sender_user) local -r pr_stats=$(github::get_pr_patch_stats) local -r pr_body=$(github::get_pr_body) - IFS=" " read -r -a pr_stats_array <<< "$pr_stats" + # IFS=" " read -r -a pr_stats_array <<< "$pr_stats" # TODO: extract actual PR comments from body, exclude Author and Reviewer checklist from PR template teamwork::add_comment " From 883ce4c32374161fa9e7d31404cc34812a63302a Mon Sep 17 00:00:00 2001 From: Richard Lock Date: Mon, 11 Nov 2024 12:24:11 -0500 Subject: [PATCH 4/4] chore: comment out unused variable --- src/teamwork.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/teamwork.sh b/src/teamwork.sh index e3c4c060..366c1e73 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -141,7 +141,7 @@ teamwork::pull_request_opened() { local -r head_ref=$(github::get_head_ref) local -r base_ref=$(github::get_base_ref) local -r user=$(github::get_sender_user) - local -r pr_stats=$(github::get_pr_patch_stats) + # local -r pr_stats=$(github::get_pr_patch_stats) local -r pr_body=$(github::get_pr_body) # IFS=" " read -r -a pr_stats_array <<< "$pr_stats" # TODO: extract actual PR comments from body, exclude Author and Reviewer checklist from PR template