File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,15 @@ jobs:
3333 - name : Set version override
3434 if : github.event_name == 'pull_request' && github.head_ref != ''
3535 run : |
36- $branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
37- $preRelease = "octopus-$branchName.${{ github.run_number }}"
38- Write-Host "PR build - using version override: $preRelease (height ignored)"
39- "MINVERDEFAULTPRERELEASEIDENTIFIERS=$preRelease" >> $env:GITHUB_ENV
40- "MINVERIGNOREHEIGHT=true" >> $env:GITHUB_ENV
36+ $gitDescribe = git describe --tags --abbrev=0 2>$null
37+ if ($gitDescribe -match '^v?(\d+\.\d+\.\d+)') {
38+ $baseVersion = $matches[1]
39+
40+ $branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
41+ $version = "$baseVersion-octopus-$branchName.${{ github.run_number }}"
42+
43+ "MINVERVERSIONOVERRIDE=$version" >> $env:GITHUB_ENV
44+ }
4145 shell : pwsh
4246 - name : Build
4347 run : dotnet build LibGit2Sharp.sln --configuration Release
You can’t perform that action at this time.
0 commit comments