Skip to content

Commit 16a3ed8

Browse files
committed
wip
1 parent bf712b3 commit 16a3ed8

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

.github/workflows/check-npm-token-permissions.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,9 @@ jobs:
1818
registry-url: 'https://registry.npmjs.org/'
1919

2020
- name: Check NPM Authentication
21-
run: |
22-
npm whoami --registry=https://registry.npmjs.org/ || echo "Not authenticated"
23-
24-
- name: Check Publish Access
2521
env:
26-
PACKAGE_NAME: "@segment/analytics-signals"
22+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2723
run: |
28-
echo "Checking permissions for package: $PACKAGE_NAME"
29-
curl -H "Authorization: Bearer $NPM_TOKEN" \
30-
https://registry.npmjs.org/-/package/$PACKAGE_NAME/access || echo "No access or invalid token"
24+
curl -H "Authorization: Bearer ${NPM_TOKEN}" https://registry.npmjs.org/-/whoami || echo "Authentication failed"
25+
3126
32-
- name: Dry-Run Publish
33-
run: |
34-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
35-
npm publish --dry-run || echo "Publish not allowed"

0 commit comments

Comments
 (0)