Require explicit NuGet PAT for Gitea package publishing
Some checks failed
NuGet Package Publish / nuget (push) Failing after 1m1s

This commit is contained in:
Joseph Doherty
2026-02-20 13:46:20 -05:00
parent 7006fd9377
commit 11e2bfc6de

View File

@@ -47,14 +47,15 @@ jobs:
shell: bash
env:
NUGET_SOURCE_URL: ${{ github.server_url }}/api/packages/${{ github.repository_owner }}/nuget/index.json
NUGET_USERNAME: ${{ secrets.NUGET_USERNAME || github.actor }}
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN || secrets.PACKAGE_TOKEN || secrets.GITHUB_TOKEN }}
NUGET_USERNAME: ${{ secrets.NUGET_USERNAME || github.repository_owner }}
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
run: |
set -euo pipefail
if [ -z "${NUGET_TOKEN:-}" ]; then
echo "NUGET_TOKEN and GITHUB_TOKEN are both unavailable."
echo "Configure one of: secrets.NUGET_TOKEN (preferred) or secrets.GITHUB_TOKEN."
echo "Missing required secret: NUGET_TOKEN"
echo "Set repository Actions secret NUGET_TOKEN to a Gitea PAT with package write permission."
echo "Optional: set NUGET_USERNAME if your PAT owner differs from repository owner."
exit 1
fi