From 22c37a0934695882a8a352b493738f07b5703d3b Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sun, 4 Oct 2026 04:33:20 +0200 Subject: [PATCH] ci: fail fast when the NuGet API key is empty --- .github/workflows/packages.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 5eb70e05..ebc1c909 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -107,6 +107,15 @@ jobs: with: name: elsa-nuget-packages + - name: Check API key (feedz.io) + env: + API_KEY: ${{ secrets.FEEDZ_API_KEY }} + run: | + if [ -z "$API_KEY" ]; then + echo "::error::API key for feedz.io is empty. Check the secret or the NuGet login (OIDC) step output that feeds it; nothing was pushed." + exit 1 + fi + - name: Publish to feedz.io run: dotnet nuget push *.nupkg -k ${{ secrets.FEEDZ_API_KEY }} -s ${{ env.feedz_feed_source }} --skip-duplicate @@ -136,5 +145,14 @@ jobs: with: user: ${{ env.nuget_user }} + - name: Check API key (nuget.org) + env: + API_KEY: ${{ steps.nuget_login.outputs.NUGET_API_KEY }} + run: | + if [ -z "$API_KEY" ]; then + echo "::error::API key for nuget.org is empty. Check the secret or the NuGet login (OIDC) step output that feeds it; nothing was pushed." + exit 1 + fi + - name: Publish to nuget.org run: dotnet nuget push *.nupkg -k ${{ steps.nuget_login.outputs.NUGET_API_KEY }} -s ${{ env.nuget_feed_source }} --skip-duplicate