mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2024-12-26 20:45:48 +00:00
Get auth working for now pending runner changes
This commit is contained in:
parent
3c9d73515f
commit
da3e59948e
2 changed files with 12 additions and 7 deletions
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue