File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,17 @@ jobs:
3333 - name : Build
3434 run : |
3535 if ("${{ github.event_name }}" -eq "pull_request" -and "${{ github.head_ref }}" -ne "") {
36- $branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
37- $preReleaseIds = "octopus-$branchName.${{ github.run_number }}"
38-
39- Write-Host "PR build - setting default pre-release identifiers to: $preReleaseIds (height ignored)"
40- $env:MINVERDEFAULTPRERELEASEIDENTIFIERS = $preReleaseIds
41- $env:MINVERIGNOREHEIGHT = "true"
36+ $gitDescribe = git describe --tags --abbrev=0 2>$null
37+ # Extract the base version number if it exists, if not don't override
38+ if ($gitDescribe -match '^v?(\d+\.\d+\.\d+)') {
39+ $baseVersion = $matches[1]
40+
41+ $branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
42+ $version = "$baseVersion-octopus-$branchName.${{ github.run_number }}"
43+
44+ Write-Host "PR build - overriding version to: $version"
45+ $env:MINVERVERSIONOVERRIDE = $version
46+ }
4247 }
4348
4449 dotnet build LibGit2Sharp.sln --configuration Release
You can’t perform that action at this time.
0 commit comments