From bd8a4d39a6bc52c01415eb278207b0f70273d51b Mon Sep 17 00:00:00 2001 From: SpecialX <47072643+wangxiner55@users.noreply.github.com> Date: Wed, 25 Feb 2026 13:34:34 +0800 Subject: [PATCH] chore: configure npm proxy in ci --- .gitea/workflows/ci.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 79f7e7a..c2210fd 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -31,15 +31,16 @@ jobs: restore-keys: | ${{ runner.os }}-node- - # - name: Configure npm registry - # run: | - # npm config set registry https://registry.npmmirror.com - # npm config set fetch-retries 5 - # npm config set fetch-retry-mintimeout 20000 - # npm config set fetch-retry-maxtimeout 120000 - # npm config set audit false - # if [ -n "$HTTP_PROXY" ]; then npm config set proxy "$HTTP_PROXY"; fi - # if [ -n "$HTTPS_PROXY" ]; then npm config set https-proxy "$HTTPS_PROXY"; fi + - name: Configure npm proxy + run: | + if [ -n "$HTTP_PROXY" ]; then npm config set proxy "$HTTP_PROXY"; fi + if [ -n "$http_proxy" ]; then npm config set proxy "$http_proxy"; fi + if [ -n "$HTTPS_PROXY" ]; then npm config set https-proxy "$HTTPS_PROXY"; fi + if [ -n "$https_proxy" ]; then npm config set https-proxy "$https_proxy"; fi + + - name: Show proxy status + run: | + if [ -n "$HTTP_PROXY" ] || [ -n "$http_proxy" ] || [ -n "$HTTPS_PROXY" ] || [ -n "$https_proxy" ]; then echo "proxy=on"; else echo "proxy=off"; fi - name: Install dependencies run: npm ci