Skip to content

Commit 85f510f

Browse files
committed
Update to handle more cases
1 parent 066107e commit 85f510f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/Release.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,21 @@ jobs:
4646
env:
4747
NUGET_API_KEY: ${{ secrets.QUANTORI_NUGET_API_KEY }}
4848
run: |
49-
if dotnet nuget push ./Behavioral.Automation.${{ env.VER }}.nupkg -s "https://api.nuget.org/v3/index.json" -k "$NUGET_API_KEY" --skip-duplicate 2>&1 | tee /dev/stderr | grep -q "403"; then
49+
exit_code=0
50+
output=$(dotnet nuget push ./Behavioral.Automation.${{ env.VER }}.nupkg -s "https://api.nuget.org/v3/index.json" -k "$NUGET_API_KEY" --skip-duplicate 2>&1) || {
51+
echo "An error occurred while running the dotnet nuget push command."
52+
exit_code=1
53+
}
54+
55+
echo "$output"
56+
echo "Exit Code: $exit_code"
57+
58+
if echo "$output" | grep -q "403"; then
5059
echo "Error: NuGet API key is invalid or expired. Please contact Quantori support to renew the key. For more details, refer to the Quantori BDD Confluence page called 'Renew NuGet API key'."
51-
exit 1
60+
exit 1
61+
elif [ $exit_code -ne 0 ]; then
62+
echo "Error: dotnet nuget push failed. Check the logs for more details."
63+
exit 1
5264
else
5365
echo "Package successfully published to NuGet.org."
5466
fi

0 commit comments

Comments
 (0)