Skip to content

Commit 6b786ce

Browse files
committed
Add conditional check for NuGet API key in publish step
1 parent e9540c0 commit 6b786ce

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/ci-cd.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,12 @@ jobs:
8888
run: dotnet pack ${{ env.PROJECT_PATH }} --no-build --configuration Release -p:PackageVersion=${{ steps.gitversion.outputs.semVer }}
8989

9090
- name: Publish to NuGet
91+
if: ${{ secrets.NUGET_API_KEY != '' }}
92+
env:
93+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
9194
run: |
9295
for package in TypescriptClientGenerator/bin/Release/*.nupkg; do
93-
dotnet nuget push "$package" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
96+
dotnet nuget push "$package" --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate
9497
done
9598
9699
- name: Upload release artifacts

0 commit comments

Comments
 (0)