Skip to content

Commit a92faf9

Browse files
authored
Merge pull request #7 from 9thCO/richard/let-the-mods-begin
feat: extract changes text from PR template
2 parents 28c5e86 + 5f6814b commit a92faf9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/teamwork.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,16 @@ teamwork::pull_request_opened() {
144144
# local -r pr_stats=$(github::get_pr_patch_stats)
145145
local -r pr_body=$(github::get_pr_body)
146146
# IFS=" " read -r -a pr_stats_array <<< "$pr_stats"
147-
# TODO: extract actual PR comments from body, exclude Author and Reviewer checklist from PR template
147+
local -r substring="##Teamwork task link" #discard anything from this text onwards in the PR template
148+
local -r extracted_body=${pr_body%%$substring*}
148149

149150
teamwork::add_comment "
150151
**$user** opened a PR: **[$pr_title]($pr_url)**
151152
\`$base_ref\` ⬅️ \`$head_ref\`
152153
153154
---
154155
155-
${pr_body}
156+
${extracted_body}
156157
"
157158

158159
teamwork::add_tag "PR Open"

0 commit comments

Comments
 (0)