From 0c31a6b0c054e46e06312a9a2b83fc01329dd717 Mon Sep 17 00:00:00 2001 From: db123 Date: Tue, 12 May 2026 11:29:46 +0330 Subject: [PATCH] fix(ci): corrected variable names and removed test --- .github/workflows/ci.yml | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d329b7..eb2a042 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout repository env: ALPINE_MIRROR: ${{ secrets.ALPINE_MIRROR }} - GITEA_TOKEN: ${{ secrets.G_TOKEN }} + G_TOKEN: ${{ secrets.G_TOKEN }} run: | set -e ALPINE_VERSION=$(cat /etc/alpine-release | cut -d'.' -f1-2) && \ @@ -27,7 +27,7 @@ jobs: HOST="${GITHUB_SERVER_URL#https://}" REPO="${{ github.repository }}" - AUTH_URL="https://${GITEA_TOKEN}@${HOST}/${REPO}.git" + AUTH_URL="https://${G_TOKEN}@${HOST}/${REPO}.git" git clone --depth 1 --branch "$GITHUB_REF_NAME" "$AUTH_URL" . @@ -56,34 +56,14 @@ jobs: - name: Publish to Gitea npm registry if: success() env: - GITEA_TOKEN: ${{ secrets.G_TOKEN }} + G_TOKEN: ${{ secrets.G_TOKEN }} run: | set -e - - # Debug: verify token exists - if [ -z "$GITEA_TOKEN" ]; then - echo "ERROR: GITEA_TOKEN is empty!" >&2 - exit 1 - fi - - # Remove any locally-committed .npmrc to avoid conflicts - rm -f .npmrc - HOST="${GITHUB_SERVER_URL#https://}" OWNER="${GITHUB_REPOSITORY_OWNER}" - - # Build registry URL without trailing slash REGISTRY="https://${HOST}/api/packages/${OWNER}/npm" - # Auth key MUST exactly match the registry path (also without trailing slash) - AUTH_KEY="//${HOST}/api/packages/${OWNER}/npm/:_authToken" + npm config set "//${HOST}/api/packages/${OWNER}/npm/:_authToken" "${G_TOKEN}" + npm config set registry "${REGISTRY}" - npm config set "$AUTH_KEY" "${GITEA_TOKEN}" - npm config set registry "$REGISTRY" - - # Double-check the effective config - echo "Effective registry: $(npm config get registry)" - echo "Token for ${HOST} is set: $(npm config get "$AUTH_KEY")" - - # Publish without --registry (uses the global config we just set) npm publish --ignore-scripts