From 7038c9653dc42146a8de7a410e725d21e1610bdc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Jun 2025 20:55:48 +0000 Subject: [PATCH 1/2] Initial plan for issue From 123b31a872b0710fa08c5167b5551d5831c3919a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:01:13 +0000 Subject: [PATCH 2/2] Fix deploy workflow error on scheduled runs - add git checkout and error handling Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com> --- .github/workflows/deploy.yml | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dcf9c5c..ef79a61 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -83,10 +83,16 @@ jobs: echo "${{ github.ref }}" $tagVersion = "${{ github.ref }}".substring(11) if ("${{ github.event_name }}" -eq "schedule") { - $tagVersion = & git describe --tags --abbrev=0 - # Remove 'v' or 'V' prefix if present for NuGet version compatibility - if ($tagVersion.StartsWith("v") -or $tagVersion.StartsWith("V")) { - $tagVersion = $tagVersion.Substring(1) + $latestTag = & git describe --tags --abbrev=0 2>&1 + if ($LASTEXITCODE -eq 0) { + $tagVersion = $latestTag + # Remove 'v' or 'V' prefix if present for NuGet version compatibility + if ($tagVersion.StartsWith("v") -or $tagVersion.StartsWith("V")) { + $tagVersion = $tagVersion.Substring(1) + } + } else { + Write-Host "No tags found, using fallback version" + $tagVersion = "0.0.1" } $tagVersion = "$tagVersion-${{ github.run_number }}" } @@ -115,6 +121,12 @@ jobs: name: Push NuGets steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + - name: Download artifact from build job uses: actions/download-artifact@v4 with: @@ -124,10 +136,16 @@ jobs: run: | $tagVersion = "${{ github.ref }}".substring(11) if ( "${{ github.event_name }}" -eq "schedule" -or "${{ github.event_name }}" -eq "push" ) { - $tagVersion = & git describe --tags --abbrev=0 - # Remove 'v' or 'V' prefix if present for NuGet version compatibility - if ($tagVersion.StartsWith("v") -or $tagVersion.StartsWith("V")) { - $tagVersion = $tagVersion.Substring(1) + $latestTag = & git describe --tags --abbrev=0 2>&1 + if ($LASTEXITCODE -eq 0) { + $tagVersion = $latestTag + # Remove 'v' or 'V' prefix if present for NuGet version compatibility + if ($tagVersion.StartsWith("v") -or $tagVersion.StartsWith("V")) { + $tagVersion = $tagVersion.Substring(1) + } + } else { + Write-Host "No tags found, using fallback version" + $tagVersion = "0.0.1" } $tagVersion = "$tagVersion-${{ github.run_number }}" }