From 1d26e299a9956ecf779ba9f422f564f21f21ff3b Mon Sep 17 00:00:00 2001 From: John Smith Date: Mon, 4 Nov 2024 10:30:52 +1030 Subject: [PATCH] chore(sdk-dotnet): Update dotnet version bump logic --- .github/workflows/publish.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fe9e1739..5e15bf23 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -96,8 +96,12 @@ jobs: id: increment_version shell: pwsh run: | - $xmlPath = ".\*.csproj" - $xml = [xml](Get-Content $xmlPath) + $projectFile = Get-ChildItem -Path . -Filter *.csproj | Select-Object -First 1 + if (-not $projectFile) { + throw "No .csproj file found in current directory" + } + + $xml = [xml](Get-Content $projectFile.FullName) $currentVersion = $xml.Project.PropertyGroup.Version if (-not $currentVersion) {