Skip to content

Commit d7ab367

Browse files
committed
Stuff
1 parent 01173c9 commit d7ab367

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,17 @@ jobs:
3030
uses: actions/setup-dotnet@v4.0.0
3131
with:
3232
dotnet-version: 9.0.x
33-
- name: Build
33+
- name: Set version override
34+
if: github.event_name == 'pull_request' && github.head_ref != ''
3435
run: |
35-
# Set version override for PR builds
36-
if ("${{ github.event_name }}" -eq "pull_request" -and "${{ github.head_ref }}" -ne "") {
37-
$branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
38-
$env:MINVERDEFAULTPRERELEASEIDENTIFIERS = "octopus-$branchName.${{ github.run_number }}"
39-
$env:MINVERIGNOHEIGHT = "true"
40-
Write-Host "PR build - using version override: $env:MINVERDEFAULTPRERELEASEIDENTIFIERS (height ignored)"
41-
}
42-
43-
# Build
44-
dotnet build LibGit2Sharp.sln --configuration Release
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
4541
shell: pwsh
42+
- name: Build
43+
run: dotnet build LibGit2Sharp.sln --configuration Release
4644
- name: Show version
4745
run: |
4846
$package = Get-ChildItem artifacts/package/*.nupkg | Select-Object -First 1

0 commit comments

Comments
 (0)