From bffbc81bc1adbcc96bdea6c7a08676eafb341740 Mon Sep 17 00:00:00 2001 From: Artur Finger Date: Wed, 29 Nov 2023 07:27:44 +0200 Subject: [PATCH] Pass token as env --- .github/actions/publish/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/publish/main.js b/.github/actions/publish/main.js index 9ac152b..dde4032 100644 --- a/.github/actions/publish/main.js +++ b/.github/actions/publish/main.js @@ -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)