Skip to content

Commit

Permalink
Pass token as env
Browse files Browse the repository at this point in the history
  • Loading branch information
fingerartur committed Nov 29, 2023
1 parent 3459c28 commit bffbc81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/actions/publish/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ const npmRcContent = `

try {
fs.writeFileSync(utils.file('.npmrc'), npmRcContent)
execSync(`export NPM_TOKEN=${npmToken}; npm publish ${args.join(' ')}`, { stdio: 'inherit' })
execSync(
`npm publish ${args.join(' ')}`,
{ stdio: 'inherit', env: { ...process.env, NPM_TOKEN: npmToken }},
)
} catch (error) {
core.error('Failed to publish to NPM' + error)
process.exit(1)
Expand Down

0 comments on commit bffbc81

Please sign in to comment.