diff --git a/.github/workflows/publish-csharp-apidocs.yml b/.github/workflows/publish-csharp-apidocs.yml index c687ddfb6f395..b2d24cbb14ecf 100644 --- a/.github/workflows/publish-csharp-apidocs.yml +++ b/.github/workflows/publish-csharp-apidocs.yml @@ -55,8 +55,9 @@ jobs: shell: pwsh run: | New-Item -Path _site/docs/api -Force -ItemType "Directory" | Out-Null - Remove-Item -Recurse -Force _site/docs/api/csharp - Move-Item -Path csharp\ApiDocs\csharp -Destination _site\docs\api\csharp + $OutputDirectory="_site/docs/api/csharp" + if (Test-Path $OutputDirectory) { Remove-Item -Recurse -Force $OutputDirectory } + Move-Item -Path csharp\ApiDocs\csharp -Destination $OutputDirectory - name: Upload docs artifact uses: actions/upload-artifact@v4 with: