Skip to content

Commit e56bf12

Browse files
JusterZhuclaude
andcommitted
fix: check LASTEXITCODE in same step as dotnet build
The separate 'Verify build success' step runs in a new PowerShell session where is always (not set by the previous step), causing ' -ne 0' to always throw. Moved the check into the Generate step. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e1a7052 commit e56bf12

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,12 @@ jobs:
173173
174174
Write-Host "=== Verifying: $templateName ==="
175175
dotnet build "$testDir\TestProject.csproj" 2>&1
176+
if ($LASTEXITCODE -ne 0) { throw "Build failed for $templateName" }
177+
Write-Host "✅ $templateName compiles successfully"
176178
177179
- name: Verify build success
178180
run: |
179-
if ($LASTEXITCODE -ne 0) { throw "Build failed for ${{ matrix.template }}" }
180-
echo "✅ ${{ matrix.template }} compiles successfully"
181+
echo "✅ ${{ matrix.template }} build was already verified in the previous step"
181182
182183
dotnet-verify-scaffold:
183184
name: .NET — Complete Scaffold Build

0 commit comments

Comments
 (0)