Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/teamwork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ 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"
# 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)**
Expand Down Expand Up @@ -194,30 +195,34 @@ 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)**

---

Review: **$review_state ✅**
$comment
if [ -z $comment ]; 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)**

---

Review: **$review_state 😔**
$comment
if [ -z $comment ]; then
Comment: $comment
fi
"
teamwork::add_tag "PR Changes Requested"
teamwork::remove_tag "PR Approved"
Expand Down