fix: use token auth header for package registry uploads
Some checks failed
release-nightly / publish-nightly (push) Failing after 48s
release / goreleaser (push) Successful in 1m15s
release / publish-packages (push) Failing after 35s

The GITHUB_TOKEN with basic auth returns 401 reqPackageAccess.
Switch to Authorization: token header which grants proper scope.
This commit is contained in:
Andrew Miller
2026-03-05 13:23:50 -05:00
parent 1b806fc393
commit 41adbc460b
2 changed files with 7 additions and 4 deletions

View File

@@ -42,19 +42,20 @@ jobs:
fi
done
- name: Publish nightly to Generic Package Registry
env:
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
API_BASE="https://git.lethalbits.com/api/packages/lethalbits/generic/gitea-mcp-extended/nightly"
echo "Publishing to: $API_BASE"
echo "Actor: ${{ gitea.actor }}"
ls -la gitea-mcp-extended_*.tar.gz gitea-mcp-extended_*.zip 2>/dev/null || true
for f in gitea-mcp-extended_*.tar.gz gitea-mcp-extended_*.zip; do
[ -f "$f" ] || continue
echo "Uploading $f..."
# Delete old nightly file first (can't overwrite)
curl -k -X DELETE --user "${{ gitea.actor }}:${{ secrets.GITHUB_TOKEN }}" \
curl -k -X DELETE -H "Authorization: token ${GITEA_TOKEN}" \
"${API_BASE}/${f}" || true
HTTP_CODE=$(curl -k -o /tmp/upload_response -w '%{http_code}' \
--user "${{ gitea.actor }}:${{ secrets.GITHUB_TOKEN }}" \
-H "Authorization: token ${GITEA_TOKEN}" \
--upload-file "$f" \
"${API_BASE}/${f}")
echo "HTTP response: $HTTP_CODE"