From da3e59948ea2f8c7dac5804da27f2cb2809bc7a7 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Tue, 6 Aug 2019 10:58:30 -0400 Subject: [PATCH] Get auth working for now pending runner changes --- lib/authutil.js | 8 ++++++-- src/authutil.ts | 11 ++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/authutil.js b/lib/authutil.js index a8bed4f9..c45f3512 100644 --- a/lib/authutil.js +++ b/lib/authutil.js @@ -13,7 +13,11 @@ const path = __importStar(require("path")); const core = __importStar(require("@actions/core")); const github = __importStar(require("@actions/github")); function configAuthentication(registryUrl) { - const npmrc = path.resolve(process.env['RUNNER_TEMP'] || process.cwd(), '.npmrc'); + // const npmrc: string = path.resolve( + // process.env['RUNNER_TEMP'] || process.cwd(), + // '.npmrc' + // ); + const npmrc = path.resolve(process.cwd(), '.npmrc'); writeRegistryToFile(registryUrl, npmrc); } exports.configAuthentication = configAuthentication; @@ -45,5 +49,5 @@ function writeRegistryToFile(registryUrl, fileLocation) { fs.writeFileSync(fileLocation, newContents); core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation); // Export empty node_auth_token so npm doesn't complain about not being able to find it - core.exportVariable('NODE_AUTH_TOKEN', 'XXXXX-XXXXX-XXXXX-XXXXX'); + // core.exportVariable('NODE_AUTH_TOKEN', 'XXXXX-XXXXX-XXXXX-XXXXX'); } diff --git a/src/authutil.ts b/src/authutil.ts index b9a4a04e..16a6dbb9 100644 --- a/src/authutil.ts +++ b/src/authutil.ts @@ -5,10 +5,11 @@ import * as core from '@actions/core'; import * as github from '@actions/github'; export function configAuthentication(registryUrl: string) { - const npmrc: string = path.resolve( - process.env['RUNNER_TEMP'] || process.cwd(), - '.npmrc' - ); + // const npmrc: string = path.resolve( + // process.env['RUNNER_TEMP'] || process.cwd(), + // '.npmrc' + // ); + const npmrc: string = path.resolve(process.cwd(), '.npmrc'); writeRegistryToFile(registryUrl, npmrc); } @@ -43,5 +44,5 @@ function writeRegistryToFile(registryUrl: string, fileLocation: string) { fs.writeFileSync(fileLocation, newContents); core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation); // Export empty node_auth_token so npm doesn't complain about not being able to find it - core.exportVariable('NODE_AUTH_TOKEN', 'XXXXX-XXXXX-XXXXX-XXXXX'); + // core.exportVariable('NODE_AUTH_TOKEN', 'XXXXX-XXXXX-XXXXX-XXXXX'); }