fix: use Mosaic credential loader for Gitea API token resolution (#7)

This commit was merged in pull request #7.
This commit is contained in:
2026-02-24 22:11:44 +00:00
parent 1fd67b9ec0
commit 09786ee6e0
7 changed files with 79 additions and 146 deletions

View File

@@ -68,11 +68,10 @@ elif [[ "$PLATFORM" == "gitea" ]]; then
DIFF_URL="https://${HOST}/api/v1/repos/${OWNER}/${REPO}/pulls/${PR_NUMBER}.diff"
# Use tea's auth token if available
TEA_TOKEN=$(tea login list 2>/dev/null | grep "$HOST" | awk '{print $NF}' || true)
GITEA_API_TOKEN=$(get_gitea_token "$HOST" || true)
if [[ -n "$TEA_TOKEN" ]]; then
DIFF_CONTENT=$(curl -sS -H "Authorization: token $TEA_TOKEN" "$DIFF_URL")
if [[ -n "$GITEA_API_TOKEN" ]]; then
DIFF_CONTENT=$(curl -sS -H "Authorization: token $GITEA_API_TOKEN" "$DIFF_URL")
else
DIFF_CONTENT=$(curl -sS "$DIFF_URL")
fi