Skip to content

Commit 20b4040

Browse files
committed
[#19] modify setNpmRc to retrieve npm_token from input and set as environment variable
1 parent 5f6bd4c commit 20b4040

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

canary-publish/dist/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53555,6 +53555,9 @@ const core = __importStar(__nccwpck_require__(6108));
5355553555
const fs = __importStar(__nccwpck_require__(77));
5355653556
function setNpmRc() {
5355753557
return __awaiter(this, void 0, void 0, function* () {
53558+
// 입력값에서 npm_token 가져오기
53559+
const npmToken = core.getInput('npm_token');
53560+
process.env.NPM_TOKEN = npmToken; // 환경변수로 설정
5355853561
core.info('No changesets found, attempting to publish any unpublished packages to npm');
5355953562
const userNpmrcPath = `${process.env.HOME}/.npmrc`;
5356053563
if (fs.existsSync(userNpmrcPath)) {

canary-publish/src/utils/npm.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import * as core from '@actions/core'
22
import * as fs from 'fs-extra'
33

44
export async function setNpmRc() {
5+
// 입력값에서 npm_token 가져오기
6+
const npmToken = core.getInput('npm_token')
7+
process.env.NPM_TOKEN = npmToken // 환경변수로 설정
8+
59
core.info('No changesets found, attempting to publish any unpublished packages to npm')
610

711
const userNpmrcPath = `${process.env.HOME}/.npmrc`

0 commit comments

Comments
 (0)