@@ -18,11 +18,56 @@ resources:
18
18
19
19
jobs :
20
20
21
+ # #############################
22
+ - job : Get_Build_Options
23
+ pool :
24
+ vmImage : ' VS2017-Win2016'
25
+
26
+ steps :
27
+ - checkout : self
28
+ fetchDepth : 1
29
+
30
+ # get commit message
31
+ - powershell : |
32
+
33
+ if($env:System_PullRequest_PullRequestId -ne '')
34
+ {
35
+ # PR build, get PR message
36
+
37
+ # need to get PR number from branch as the Azure Pipeline var can't be trusted
38
+ if($env:Build_SourceBranch -match '(?<=(pull\/))\w*(?=(\/))')
39
+ {
40
+ $prNumber = $matches[0]
41
+
42
+ $prUrl = "https://api.github.com/repos/$env:Build_Repository_Name/pulls/$prNumber"
43
+
44
+ $commit = Invoke-RestMethod -Uri $prUrl -ContentType "application/json" -Method GET
45
+
46
+ $commitMessage = $commit.body
47
+ }
48
+ }
49
+ else
50
+ {
51
+ # not a PR, get subject and commit message for commit
52
+ $commitMessage = git log --format='%B' -1
53
+ }
54
+
55
+ # need to flatten message by removing new lines
56
+ $commitMessage = $commitMessage -replace "`r`n", " "
57
+
58
+ # set variable to foward to jobs
59
+ echo "##vso[task.setvariable variable=COMMIT_MESSAGE;isOutput=true]$commitMessage"
60
+ name: GetCommitMessage
61
+ displayName: grab commit message
62
+
21
63
# #############################
22
64
23
65
# build MDP
24
66
- job : Build_MDP
25
- condition : not( or( contains(variables['Build.SourceVersionMessage'], '***UPDATE_DEPENDENTS***'), eq(variables['UPDATE_DEPENDENTS'], 'true') ) )
67
+ condition : not( or( contains(dependencies.Get_Build_Options.outputs['GetCommitMessage.COMMIT_MESSAGE'], '***UPDATE_DEPENDENTS***'), eq(variables['UPDATE_DEPENDENTS'], 'true') ) )
68
+
69
+ dependsOn :
70
+ - Get_Build_Options
26
71
27
72
pool :
28
73
vmImage : ' VS2017-Win2016'
@@ -143,10 +188,11 @@ jobs:
143
188
144
189
# #############################
145
190
- job : Update_Dependents
146
- condition : or( contains(variables['Build.SourceVersionMessage '], '***UPDATE_DEPENDENTS***'), eq(variables['UPDATE_DEPENDENTS'], 'true') )
191
+ condition : or( contains(dependencies.Get_Build_Options.outputs['GetCommitMessage.COMMIT_MESSAGE '], '***UPDATE_DEPENDENTS***'), eq(variables['UPDATE_DEPENDENTS'], 'true') )
147
192
148
193
dependsOn :
149
- - Build_MDP
194
+ - Get_Build_Options
195
+ - Build_MDP
150
196
151
197
pool :
152
198
vmImage : ' VS2017-Win2016'
@@ -158,9 +204,6 @@ jobs:
158
204
159
205
- template : azure-pipelines-templates/install-nbgv-tool.yml@templates
160
206
161
- - script : nbgv cloud -a -c
162
- displayName : Set build number
163
-
164
207
# update dependencies
165
208
- task : PowerShell@2
166
209
displayName : Update dependent class libs
0 commit comments