Skip to content

Commit 4ba7f7c

Browse files
committed
Clean
1 parent e0f56d7 commit 4ba7f7c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)