File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,11 +108,24 @@ try {
108108 process . exit ( 1 )
109109 }
110110
111+ // Check for npm token in environment variable
112+ const npmToken = process . env . NPM_TOKEN
113+
114+ if ( npmToken ) {
115+ console . log ( colors . green ( '🔑 Using NPM_TOKEN from environment variable' ) )
116+ // Configure npm registry auth token via user-level config
117+ // Use automation token (no 2FA required) from: https://www.npmjs.com/settings/<your-username>/tokens
118+ // This doesn't modify project .npmrc file, only sets user-level config
119+ await $ `pnpm config set //registry.npmjs.org/:_authToken ${ npmToken } `
120+ console . log ( colors . green ( '✅ Configured npm authentication' ) )
121+ }
122+
111123 console . log ( colors . yellow ( '📤 Publishing to npm...' ) )
112124 await $ `pnpm publish`
113125
114126 console . log ( colors . yellow ( '🔗 Pushing to GitHub...' ) )
115- await $ `git push origin main --follow-tags`
127+ await $ `git push origin main`
128+ await $ `git push origin ${ tagName } `
116129
117130 console . log ( colors . yellow ( '📋 Creating GitHub Release...' ) )
118131 await $ `node scripts/create-github-release.js`
You can’t perform that action at this time.
0 commit comments