Skip to content

Commit f11d199

Browse files
docs: document NPM token expiration and rotation requirements
NPM now only supports granular access tokens which expire after 1 year. Added documentation to workflow comments explaining: - Token expires after 1 year - Requires yearly rotation - How to generate new token on npmjs.com Users should set a calendar reminder before token expiration.
1 parent 50df381 commit f11d199

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# category: ci
44
# type: template
55
# name: NPM Publish
6-
# description: Automatically publish to npm when version changes on main branch
6+
# description: Automatically publish to npm when version changes on main branch. NOTE: NPM_TOKEN is a granular access token that expires after 1 year and must be rotated annually.
77
# secrets:
88
# - name: NPM_TOKEN
9-
# description: NPM authentication token with publish access
9+
# description: NPM granular access token with publish access (expires after 1 year, requires yearly rotation)
1010
# required: true
1111
# inputs: []
1212
# triggers: [push]
@@ -60,6 +60,9 @@ jobs:
6060
echo "Version unchanged: $CURRENT_VERSION"
6161
fi
6262
63+
# NOTE: NPM_TOKEN is a granular access token that expires after 1 year.
64+
# Set a calendar reminder to rotate this token before it expires.
65+
# Go to npmjs.com → Access Tokens → Generate New Token → Granular Access Token
6366
- name: Publish to npm
6467
if: steps.check.outputs.version_changed == 'true'
6568
env:

workflows/ci/npm-publish/npm-publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# category: ci
44
# type: template
55
# name: NPM Publish
6-
# description: Automatically publish to npm when version changes on main branch
6+
# description: Automatically publish to npm when version changes on main branch. NOTE: NPM_TOKEN is a granular access token that expires after 1 year and must be rotated annually.
77
# secrets:
88
# - name: NPM_TOKEN
9-
# description: NPM authentication token with publish access
9+
# description: NPM granular access token with publish access (expires after 1 year, requires yearly rotation)
1010
# required: true
1111
# inputs: []
1212
# triggers: [push]
@@ -60,6 +60,9 @@ jobs:
6060
echo "Version unchanged: $CURRENT_VERSION"
6161
fi
6262
63+
# NOTE: NPM_TOKEN is a granular access token that expires after 1 year.
64+
# Set a calendar reminder to rotate this token before it expires.
65+
# Go to npmjs.com → Access Tokens → Generate New Token → Granular Access Token
6366
- name: Publish to npm
6467
if: steps.check.outputs.version_changed == 'true'
6568
env:

0 commit comments

Comments
 (0)