File tree Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ if [ -n "$pull_requests" ]; then
110
110
text=$( echo " $comment " | jq -r ' .text' )
111
111
112
112
# check for progress or finished messages => do not include in versions when available
113
- if bitbucket_pullrequest_progress_commit_match " $text " " $prq_hash " ; then
113
+ if bitbucket_pullrequest_comment_commit_match " $text " " $prq_hash " ; then
114
114
log " Skipping PRQ #$prq_number since already handled"
115
115
skip_build=true
116
116
break
Original file line number Diff line number Diff line change @@ -143,6 +143,16 @@ bitbucket_pullrequest_progress_commit_match() {
143
143
echo " $comment " | grep -Ec " ^$( regex_escape " $msg " ) " > /dev/null
144
144
}
145
145
146
+ bitbucket_pullrequest_comment_commit_match () {
147
+ # $1: pull request comment
148
+ # $2: pull request hash
149
+ local comment=" $1 "
150
+ local hash=" $2 "
151
+
152
+ local msg=" )** for $hash into"
153
+ echo " $comment " | grep -Ec " $( regex_escape " $msg " ) " > /dev/null
154
+ }
155
+
146
156
bitbucket_pullrequest_progress_comment () {
147
157
# $1: status (success, failure or pending)
148
158
# $2: hash of merge commit
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ submodules=$(jq -r '(.params.submodules // "all")' < "$payload")
45
45
disable_git_lfs=$( jq -r ' (.params.disable_git_lfs // false)' < " $payload " )
46
46
47
47
prq_id=$( jq -r ' .version.id // ""' < " $payload " )
48
+ prq_date=$( jq -r ' .version.date // ""' < " $payload " )
48
49
49
50
configure_git_ssl_verification " $skip_ssl_verification "
50
51
configure_git_global " ${git_config_payload} "
@@ -136,6 +137,7 @@ git config --add pullrequest.id $prq_id
136
137
git config --add pullrequest.source $source_commit
137
138
git config --add pullrequest.target $target_commit
138
139
git config --add pullrequest.merge $ref
140
+ git config --add pullrequest.date " $prq_date "
139
141
140
142
jq -n " {
141
143
version: $( jq ' .version' < " $payload " ) ,
Original file line number Diff line number Diff line change @@ -140,8 +140,8 @@ data=$(jq -cn "{
140
140
# set commit build status for source commit
141
141
bitbucket_pullrequest_commit_status " $repo_host " " $source_commit " " $data " " " " " " $skip_ssl_verification "
142
142
143
- # use the current commit timestamp as date
144
- prq_verify_date=$( git log -1 --format=format:%at )
143
+ # use the pullrequest date stored in git config in get
144
+ prq_verify_date=$( git config --get pullrequest.date | cat )
145
145
146
146
# add comment to pull request to track if build was started/finished
147
147
comment_message=$( bitbucket_pullrequest_progress_comment " $status " " $prq_hash " " $source_commit " " $target_commit " )
@@ -165,7 +165,7 @@ if [ -n "$comments" ]; then
165
165
# edit timestamp to force new build when rebuild_phrase is included in comments
166
166
if [ " $skip_verify " != " true" ]; then
167
167
if echo " $text " | grep -Ec " $rebuild_phrase " > /dev/null; then
168
- prq_verify_date=$(( ($(echo "$comment " | jq - r '.createdDate') + 500 ) / 1000 ))
168
+ prq_verify_date=$( date_from_epoch_seconds $(( ($(echo "$comment " | jq - r '.createdDate') + 500 ) / 1000 ) ))
169
169
skip_verify=true
170
170
fi
171
171
fi
@@ -184,7 +184,7 @@ jq -n "{
184
184
version: {
185
185
id: \" $prq_number \" ,
186
186
hash: \" $prq_hash \" ,
187
- date: \" $( date_from_epoch_seconds " $ prq_verify_date" ) \"
187
+ date: \" $prq_verify_date \"
188
188
},
189
189
metadata: $( pullrequest_metadata " $prq_number " " $uri " " $skip_ssl_verification " )
190
190
}" >&3
You can’t perform that action at this time.
0 commit comments