File tree 2 files changed +13
-0
lines changed 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ parameters:
19
19
displayName : " Git tag"
20
20
type : string
21
21
default : main
22
+ - name : SourceCommit
23
+ displayName : " Git commit (empty to disable commit SHA check)"
24
+ type : string
25
+ default : ' '
22
26
- name : DoPublish
23
27
displayName : " Publish release"
24
28
type : boolean
@@ -90,6 +94,7 @@ variables:
90
94
${{ else }} :
91
95
GitRemote : ${{ parameters.GitRemote_Other }}
92
96
SourceTag : ${{ parameters.SourceTag }}
97
+ SourceCommit : ${{ parameters.SourceCommit }}
93
98
${{ if ne(parameters.SigningCertificate, 'Unsigned') }} :
94
99
SigningCertificate : ${{ parameters.SigningCertificate }}
95
100
SigningDescription : ${{ parameters.SigningDescription }}
Original file line number Diff line number Diff line change @@ -19,3 +19,11 @@ steps:
19
19
- script : git clone --progress -v --depth ${{ parameters.depth }} --branch $(Build.SourceBranchName) --single-branch $(Build.Repository.Uri) .
20
20
displayName : ' git clone'
21
21
condition : and(succeeded(), and(not(variables['GitRemote']), not(variables['SourceTag'])))
22
+
23
+ - powershell : |
24
+ $checkout_commit = (git rev-parse HEAD)
25
+ if ($checkout_commit -ne $GitCommit) {
26
+ throw "Expected git commit '$(GitCommit)' didn't match tagged commit '$(checkout_commit)'"
27
+ }
28
+ displayName : " Verify CPython commit matches tag"
29
+ condition : and(succeeded(), and(variables['GitCommit']))
You can’t perform that action at this time.
0 commit comments