From eb285f64d4fbf9dbf0047f6d26ff2f6189de04a9 Mon Sep 17 00:00:00 2001 From: Richard Lock Date: Mon, 11 Nov 2024 13:33:54 -0500 Subject: [PATCH 1/3] chore: further modifications --- src/teamwork.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/teamwork.sh b/src/teamwork.sh index 611411fa..10337166 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -195,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, don't include body message if [ "$review_state" == "approved" ]; then teamwork::add_comment " **$user** submitted a review to the PR: **[$pr_title]($pr_url)** @@ -203,25 +203,20 @@ teamwork::pull_request_review_submitted() { --- Review: **$review_state ✅**" -if [ -n "$comment" ]; then - teamwork::add_comment "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, include body message if [ "$review_state" == "changes_requested" ]; then teamwork::add_comment " **$user** submitted a change request to the PR: **[$pr_title]($pr_url)** --- -Review: **$review_state 😔**" -if [ -n "$comment" ]; then - teamwork::add_comment "Comment: $comment" -fi +Review: **$review_state 😔** +Comment: $comment" teamwork::add_tag "PR Changes Requested" teamwork::remove_tag "PR Approved" From 24aabf8c1b9a6f1fa863a5233edd806fd52fd4e7 Mon Sep 17 00:00:00 2001 From: Richard Lock Date: Mon, 11 Nov 2024 13:35:43 -0500 Subject: [PATCH 2/3] chore: test --- src/teamwork.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/teamwork.sh b/src/teamwork.sh index 10337166..d439c75a 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -228,7 +228,8 @@ teamwork::pull_request_review_dismissed() { local -r user=$(github::get_sender_user) teamwork::add_comment "Review dismissed by $user" if [ -n "$comment" ]; then - teamwork::add_comment "Comment: $comment" + else + teamwork::add_comment "Comment: $comment" fi teamwork::remove_tag "PR Open" teamwork::remove_tag "PR Approved" From 639851578e4389a0a901a0a48d3eeff95e235152 Mon Sep 17 00:00:00 2001 From: Richard Lock Date: Mon, 11 Nov 2024 13:38:36 -0500 Subject: [PATCH 3/3] fix: linter issues --- src/teamwork.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/teamwork.sh b/src/teamwork.sh index d439c75a..32e5c31e 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -227,7 +227,8 @@ Comment: $comment" teamwork::pull_request_review_dismissed() { local -r user=$(github::get_sender_user) teamwork::add_comment "Review dismissed by $user" - if [ -n "$comment" ]; then + if [ -z "$comment" ]; then + true else teamwork::add_comment "Comment: $comment" fi