зеркало из https://github.com/microsoft/msquic.git
Validate pipeline commit matches resource in vpack publish (#2425)
* Validate branch when publishing * Yml fix * Another try * Just move to templates * 1 more fix * Keep trying * Just put it in prepare * Another try * Better validation
This commit is contained in:
Родитель
f9f131d11e
Коммит
f6df9317bb
|
@ -14,6 +14,12 @@ jobs:
|
|||
- name: runCodesignValidationInjection
|
||||
value: false
|
||||
steps:
|
||||
- task: Powershell@2
|
||||
displayName: Validate package commits
|
||||
inputs:
|
||||
pwsh: true
|
||||
filePath: scripts/validate-package-commits.ps1
|
||||
arguments: -ResourceCommit $(resources.pipeline.onebranch.sourceCommit) -ResourceBranch $(resources.pipeline.onebranch.sourceBranch) -PipelineCommit $(Build.SourceVersion) -PipelineBranch $(Build.SourceBranch)
|
||||
- template: ./download-artifacts.yml
|
||||
parameters:
|
||||
platform: winkernel
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
param (
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$ResourceCommit,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$ResourceBranch,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$PipelineCommit,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$PipelineBranch
|
||||
)
|
||||
|
||||
$Failed = $false
|
||||
|
||||
if ($ResourceCommit -ne $PipelineCommit) {
|
||||
Write-Host "##vso[task.LogIssue type=error;]Mismatched commits. Resource: $ResourceCommit Pipeline: $PipelineCommit"
|
||||
$Failed = $true
|
||||
}
|
||||
|
||||
if ($ResourceBranch -ne $PipelineBranch) {
|
||||
Write-Host "##vso[task.LogIssue type=error;]Mismatched branches. Resource: $ResourceBranch Pipeline: $PipelineBranch"
|
||||
$Failed = $true
|
||||
}
|
||||
|
||||
if ($Failed) {
|
||||
exit 1
|
||||
}
|
Загрузка…
Ссылка в новой задаче