File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,15 @@ github::get_pr_number() {
13
13
}
14
14
15
15
github::get_pr_body () {
16
- jq --raw-output .pull_request.body " $GITHUB_EVENT_PATH "
16
+ jq --raw-output .pull_request.body " $GITHUB_EVENT_PATH " | sed -r ' s/^#{1,3}\ /#### /g'
17
+ }
18
+
19
+ github::get_head_ref () {
20
+ jq --raw-output .pull_request.head.ref " $GITHUB_EVENT_PATH "
21
+ }
22
+
23
+ github::get_base_ref () {
24
+ jq --raw-output .pull_request.base.ref " $GITHUB_EVENT_PATH "
17
25
}
18
26
19
27
github::get_repository_full_name () {
Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ teamwork::remove_tag() {
71
71
teamwork::pull_request_opened () {
72
72
local -r pr_url=$( github::get_pr_url)
73
73
local -r pr_title=$( github::get_pr_title)
74
+ local -r head_ref=$( github::get_head_ref)
75
+ local -r base_ref=$( github::get_base_ref)
74
76
local -r user=$( github::get_sender_user)
75
77
local -r pr_stats=$( github::get_pr_patch_stats)
76
78
local -r pr_body=$( github::get_pr_body)
@@ -79,14 +81,16 @@ teamwork::pull_request_opened() {
79
81
teamwork::add_comment "
80
82
**$user ** opened a PR: **$pr_title **
81
83
[$pr_url ]($pr_url )
84
+ \` $base_ref \` <- \` $head_ref \`
82
85
83
86
---
84
87
85
- ${pr_body//###/#### }
88
+ ${pr_body}
86
89
87
90
---
88
91
89
92
🔢 ${pr_stats_array[0]} commits / 📝 ${pr_stats_array[1]} files updated / ➕ ${pr_stats_array[2]} additions / ➖ ${pr_stats_array[3]} deletions
93
+
90
94
"
91
95
92
96
teamwork::add_tag " PR Open"
Original file line number Diff line number Diff line change 2
2
"action" : " opened" ,
3
3
"number" : 1 ,
4
4
"pull_request" : {
5
- "body" : " This is the body of the PR. https://xxxx.teamwork.com/#/tasks/123 https://xxx.teamwork.com/#/tasks/456" ,
5
+ "body" : " # Test heading \n This is the body of the PR. https://xxxx.teamwork.com/#/tasks/123 https://xxx.teamwork.com/#/tasks/456" ,
6
6
"head" : {
7
+ "ref" : " pr-branch" ,
7
8
"repo" : {
8
9
"full_name" : " teamwork/github-sync"
9
10
}
10
11
},
12
+ "base" : {
13
+ "ref" : " main"
14
+ },
11
15
"html_url" : " https://github.com/teamwork/github-sync/pull/1" ,
12
16
"title" : " This is an example of a title for the PR." ,
13
17
"commits" : 1 ,
18
22
"sender" : {
19
23
"login" : " username"
20
24
}
21
- }
25
+ }
You can’t perform that action at this time.
0 commit comments