Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check NPM Publish Permissions | |
on: | |
push: | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
jobs: | |
check-npm-permissions: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org/' | |
- name: Configure npm authentication | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc | |
- run: npm whoami --registry=https://registry.npmjs.org/ || echo "Not authenticated" | |
- name: List Packages I can access | |
run: | | |
npm access list packages | |
- name: Check NPM Authentication | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
curl -H "Authorization: Bearer ${NPM_TOKEN}" https://registry.npmjs.org/-/whoami || echo "Authentication failed" | |