name: Publish to Verdaccio on: push: branches: [ main, master ] jobs: publish: runs-on: docker steps: - name: Check NPM_TOKEN and configure registry env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | if [ -z "$NPM_TOKEN" ]; then echo "Error: NPM_TOKEN secret is not set" exit 1 fi npm config set registry http://verdaccio:4873/ npm config set //verdaccio:4873/:_authToken "$NPM_TOKEN" npm whoami # 验证身份