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