Skip to content
name: Check NPM Publish Permissions
on:
push:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# - name: Configure npm authentication
# run: |
# echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
- name: Check NPM Authentication
run: |
curl -H "Authorization: Bearer ${{ secrets.NPM_TOKEN}}" https://registry.npmjs.org/-/whoami
- name: List Packages I can access
run: |
npm access list packages
- run: npm whoami