Workflow file for this run
This file contains hidden or 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: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - 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 || echo "Authentication failed" | |
| - name: Configure npm authentication | |
| run: | | |
| echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
| - name: Check NPM Authentication | |
| run: | | |
| curl -H "Authorization: Bearer ${{ secrets.NPM_TOKEN}}" https://registry.npmjs.org/-/whoami || echo "Authentication failed" | |
| - run: npm whoami | |
| - name: List Packages I can access | |
| run: | | |
| npm access list packages | |