From cc65e01c026db288b0b723b21a226ed32a7df91f Mon Sep 17 00:00:00 2001 From: Richard Lock Date: Mon, 11 Nov 2024 12:59:03 -0500 Subject: [PATCH 1/3] fix: proper checking to include comment --- src/teamwork.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/teamwork.sh b/src/teamwork.sh index a609d0bc..45755e83 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -203,7 +203,7 @@ teamwork::pull_request_review_submitted() { --- Review: **$review_state ✅**" -if [ -z "$comment" ]; then +if [ ! -z "$comment" ]; then teamwork::add_comment "Comment: $comment" fi teamwork::add_tag "PR Approved" @@ -219,7 +219,7 @@ fi --- Review: **$review_state 😔**" -if [ -z "$comment" ]; then +if [ ! -z "$comment" ]; then teamwork::add_comment "Comment: $comment" fi @@ -232,7 +232,7 @@ fi teamwork::pull_request_review_dismissed() { local -r user=$(github::get_sender_user) teamwork::add_comment "Review dismissed by $user" - if [ -z "$comment" ]; then + if [ ! -z "$comment" ]; then teamwork::add_comment "Comment: $comment" fi teamwork::remove_tag "PR Open" From 62f5e86d21b54e3e74239bb346bc87c9f75813d4 Mon Sep 17 00:00:00 2001 From: Richard Lock Date: Mon, 11 Nov 2024 13:09:09 -0500 Subject: [PATCH 2/3] fix: linter syntax fixes --- src/teamwork.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/teamwork.sh b/src/teamwork.sh index 45755e83..026681e8 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -203,7 +203,7 @@ teamwork::pull_request_review_submitted() { --- Review: **$review_state ✅**" -if [ ! -z "$comment" ]; then +if [ -n -z "$comment" ]; then teamwork::add_comment "Comment: $comment" fi teamwork::add_tag "PR Approved" @@ -219,7 +219,7 @@ fi --- Review: **$review_state 😔**" -if [ ! -z "$comment" ]; then +if [ -n -z "$comment" ]; then teamwork::add_comment "Comment: $comment" fi @@ -232,7 +232,7 @@ fi teamwork::pull_request_review_dismissed() { local -r user=$(github::get_sender_user) teamwork::add_comment "Review dismissed by $user" - if [ ! -z "$comment" ]; then + if [ -n -z "$comment" ]; then teamwork::add_comment "Comment: $comment" fi teamwork::remove_tag "PR Open" From 98311793dd36fc9e4cf6128cc22b0357d51db6ba Mon Sep 17 00:00:00 2001 From: Richard Lock Date: Mon, 11 Nov 2024 13:13:31 -0500 Subject: [PATCH 3/3] fix: bad syntax --- src/teamwork.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/teamwork.sh b/src/teamwork.sh index 026681e8..611411fa 100644 --- a/src/teamwork.sh +++ b/src/teamwork.sh @@ -203,7 +203,7 @@ teamwork::pull_request_review_submitted() { --- Review: **$review_state ✅**" -if [ -n -z "$comment" ]; then +if [ -n "$comment" ]; then teamwork::add_comment "Comment: $comment" fi teamwork::add_tag "PR Approved" @@ -219,7 +219,7 @@ fi --- Review: **$review_state 😔**" -if [ -n -z "$comment" ]; then +if [ -n "$comment" ]; then teamwork::add_comment "Comment: $comment" fi @@ -232,7 +232,7 @@ fi teamwork::pull_request_review_dismissed() { local -r user=$(github::get_sender_user) teamwork::add_comment "Review dismissed by $user" - if [ -n -z "$comment" ]; then + if [ -n "$comment" ]; then teamwork::add_comment "Comment: $comment" fi teamwork::remove_tag "PR Open"