Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,14 @@ function Check-EditedFiles() {

function Check-RequiredVersionBumps() {
# Log VSTS errors for missing required version bumps
if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH) {
$targetBranch = $env:SYSTEM_PULLREQUEST_TARGETBRANCH
if ($targetBranch) {
# Prepend remote reference if the branch is not local
if (!$targetBranch.StartsWith("refs/head/")) {
$targetBranch = "refs/remotes/origin/" + $targetBranch
}
$versionLineChanged = $false
git --no-pager diff --unified --no-color --exit-code -w origin/$env:SYSTEM_PULLREQUEST_TARGETBRANCH HEAD src\Framework\EngineServices.cs `
git --no-pager diff --unified --no-color --exit-code -w $targetBranch HEAD src\Framework\EngineServices.cs `
| Select-String -Pattern "int Version =" | ForEach-Object -process { $versionLineChanged = $true }
if (($LASTEXITCODE -ne 0) -and (-not $versionLineChanged)) {
throw "##vso[task.logissue type=error] Detected changes in Framework\EngineServices.cs without a version bump. " +
Expand Down