mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-06-10 14:11:11 +00:00
Fix tests for always-auth
This commit is contained in:
parent
9c950f557c
commit
17f3fe1837
6 changed files with 36 additions and 32 deletions
|
@ -12,15 +12,15 @@ const os = __importStar(require("os"));
|
|||
const path = __importStar(require("path"));
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const github = __importStar(require("@actions/github"));
|
||||
function configAuthentication({ registryUrl, alwaysAuth }) {
|
||||
function configAuthentication(registryUrl, alwaysAuth) {
|
||||
const npmrc = path.resolve(process.env['RUNNER_TEMP'] || process.cwd(), '.npmrc');
|
||||
if (!registryUrl.endsWith('/')) {
|
||||
registryUrl += '/';
|
||||
}
|
||||
writeRegistryToFile({ registryUrl, fileLocation: npmrc, alwaysAuth });
|
||||
writeRegistryToFile(registryUrl, npmrc, alwaysAuth);
|
||||
}
|
||||
exports.configAuthentication = configAuthentication;
|
||||
function writeRegistryToFile({ registryUrl, fileLocation, alwaysAuth }) {
|
||||
function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
|
||||
let scope = core.getInput('scope');
|
||||
if (!scope && registryUrl.indexOf('npm.pkg.github.com') > -1) {
|
||||
scope = github.context.repo.owner;
|
||||
|
|
|
@ -37,7 +37,7 @@ function run() {
|
|||
const registryUrl = core.getInput('registry-url');
|
||||
const alwaysAuth = core.getInput('always-auth');
|
||||
if (registryUrl) {
|
||||
auth.configAuthentication({ registryUrl, alwaysAuth });
|
||||
auth.configAuthentication(registryUrl, alwaysAuth);
|
||||
}
|
||||
// TODO: setup proxy from runner proxy config
|
||||
const matchersPath = path.join(__dirname, '..', '.github');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue