chore(ci): revert to enable trusted publishing workflow - #203
Conversation
This reverts commit ec839b9.
WalkthroughThe ChangesNuGet Publishing Workflow Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/main.yaml (1)
244-250: ⚡ Quick winAvoid masking real symbol-push failures.
On Line 249 and Line 257,
|| echo "No symbol package found or already published."also swallows real push errors (auth/network/service), which can hide release issues.Proposed adjustment
- name: Publish to NuGet run: | echo "Publishing primary package to NuGet (.nupkg)..."; dotnet nuget push dist/OpenFga.Sdk.*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --skip-duplicate --source https://api.nuget.org/v3/index.json echo "Publishing symbol package to NuGet (.snupkg)..."; - dotnet nuget push dist/OpenFga.Sdk.*.snupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --skip-duplicate --source https://api.nuget.org/v3/index.json || echo "No symbol package found or already published." + if compgen -G "dist/OpenFga.Sdk.*.snupkg" > /dev/null; then + dotnet nuget push dist/OpenFga.Sdk.*.snupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --skip-duplicate --source https://api.nuget.org/v3/index.json + else + echo "No symbol package found." + fi - name: Publish to GitHub Package Registry continue-on-error: true run: | echo "Publishing primary package to GitHub Package Registry (.nupkg)..."; dotnet nuget push dist/OpenFga.Sdk.*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --source https://nuget.pkg.github.com/openfga/index.json echo "Publishing symbol package to GitHub Package Registry (.snupkg)..."; - dotnet nuget push dist/OpenFga.Sdk.*.snupkg --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --source https://nuget.pkg.github.com/openfga/index.json || echo "No symbol package found or already published." + if compgen -G "dist/OpenFga.Sdk.*.snupkg" > /dev/null; then + dotnet nuget push dist/OpenFga.Sdk.*.snupkg --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --source https://nuget.pkg.github.com/openfga/index.json + else + echo "No symbol package found." + fiAlso applies to: 251-258
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/main.yaml around lines 244 - 250, The current publish step masks real failures by appending "|| echo 'No symbol package found or already published.'" to the dotnet nuget push for symbol packages (the command matching "dotnet nuget push dist/OpenFga.Sdk.*.snupkg"), which hides auth/network/service errors; modify the job so it first checks for the presence of symbol files (e.g., glob for dist/OpenFga.Sdk.*.snupkg) and only attempts dotnet nuget push when files exist, and remove the trailing "|| echo ..." fallback so that dotnet nuget push failures (auth/network/service) surface and fail the workflow—ensure the primary push command ("dotnet nuget push dist/OpenFga.Sdk.*.nupkg") remains unchanged and still uses --skip-duplicate but does not swallow errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/main.yaml:
- Around line 244-250: The current publish step masks real failures by appending
"|| echo 'No symbol package found or already published.'" to the dotnet nuget
push for symbol packages (the command matching "dotnet nuget push
dist/OpenFga.Sdk.*.snupkg"), which hides auth/network/service errors; modify the
job so it first checks for the presence of symbol files (e.g., glob for
dist/OpenFga.Sdk.*.snupkg) and only attempts dotnet nuget push when files exist,
and remove the trailing "|| echo ..." fallback so that dotnet nuget push
failures (auth/network/service) surface and fail the workflow—ensure the primary
push command ("dotnet nuget push dist/OpenFga.Sdk.*.nupkg") remains unchanged
and still uses --skip-duplicate but does not swallow errors.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2be3b665-b12c-40e5-8ad3-a0f05bd49392
📒 Files selected for processing (1)
.github/workflows/main.yaml
Reverts #167
closes: #123
Related:
Summary by CodeRabbit