Skip to content

Commit 29b4d0c

Browse files
committed
Revert "chore: avoid npm token for publishing packages (#2459)"
This reverts commit 45dce73.
1 parent effa3c1 commit 29b4d0c

4 files changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/deploy-beta.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ jobs:
163163
trigger_source: ${{ needs.get-deploy-inputs.outputs.trigger_source }}
164164
secrets:
165165
RS_PROD_BUGSNAG_API_KEY: ${{ secrets.RS_PROD_BUGSNAG_API_KEY }}
166+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
166167
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
167168
SLACK_RELEASE_CHANNEL_ID: ${{ secrets.SLACK_RELEASE_CHANNEL_ID_NON_PROD }}
168169

.github/workflows/deploy-npm.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ on:
4040
secrets:
4141
RS_PROD_BUGSNAG_API_KEY:
4242
required: true
43+
NPM_TOKEN:
44+
required: true
4345
SLACK_BOT_TOKEN:
4446
required: true
4547
SLACK_RELEASE_CHANNEL_ID:
@@ -156,11 +158,13 @@ jobs:
156158
- name: Publish package to NPM
157159
env:
158160
HUSKY: 0
161+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
159162
NPM_CONFIG_PROVENANCE: true
160163
run: |
161164
# Remove unnecessary fields from package.json before publishing
162165
./scripts/make-package-json-publish-ready.sh
163166
167+
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
164168
npx nx release publish --verbose --base=${{ env.last_monorepo_version }} --head=${{ env.current_monorepo_version }} ${{ inputs.environment == 'beta' && '--tag=beta' || '' }}
165169
166170
# Reset the changes made to package.json
@@ -202,8 +206,10 @@ jobs:
202206
- name: Deprecate the legacy SDK NPM package
203207
continue-on-error: true
204208
env:
209+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
205210
NPM_CONFIG_PROVENANCE: true
206211
run: |
212+
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
207213
208214
npm deprecate rudder-sdk-js "This package is deprecated and no longer maintained. While your events are still being tracked and delivered, we strongly recommend you to migrate to the latest package, @rudderstack/analytics-js (https://www.npmjs.com/package/@rudderstack/analytics-js), for the latest features, security updates, and improved performance. For more details, visit the migration guide: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/migration-guide/."
209215

.github/workflows/publish-new-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ jobs:
269269
monorepo_release_version: ${{ needs.get-release-inputs.outputs.release_version }}
270270
release_ticket_id: ${{ needs.get-release-inputs.outputs.release_ticket_id }}
271271
secrets:
272+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
272273
RS_PROD_BUGSNAG_API_KEY: ${{ secrets.RS_PROD_BUGSNAG_API_KEY }}
273274
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
274275
SLACK_RELEASE_CHANNEL_ID: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}

.github/workflows/rollback.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,14 @@ jobs:
166166
- name: Deprecate the rolled back NPM version
167167
continue-on-error: true
168168
env:
169+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
169170
NPM_CONFIG_PROVENANCE: true
170171
run: |
171172
VERSION_TO_DEPRECATE="${{ env.CURRENT_VERSION_VALUE }}"
172173
echo "Deprecating NPM version: $VERSION_TO_DEPRECATE"
173174
174175
# Deprecate the specified version with a message
176+
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
175177
npm deprecate "@rudderstack/analytics-js@$VERSION_TO_DEPRECATE" "We've identified issues with this version of the package. Please switch to v${{ env.ROLLBACK_VERSION_VALUE }} or the latest version if available."
176178
177179
# Note: The legacy SDK is not deprecated as it is deprecated by default with every release.

0 commit comments

Comments
 (0)