Skip to content

wip

wip #6

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
- name: Check NPM Publish Access
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PACKAGE_NAME: "@segment/analytics-next"
run: |
npm access ls-collaborators $PACKAGE_NAME
npm owner ls $PACKAGE_NAME
- 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"