mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-25 08:24:28 -04:00
Add auth support (#21)
* Updates * Update * Update * Update * Update * Yarn sometimes prefers npmrc, so use same token * Description * Update readme * Feedback * Add type * new toolkit and scoped registries * npmrc in RUNNER_TEMP * Dont always auth * Try exporting blank token * Get auth working for now pending runner changes * Fix string interpolation for auth token. * Don't export both userconfigs * Update authutil.js * Add single quotes for authString * Fix the registry string. * Use userconfig and append trailing slash * Keep in root of repo * Try just adding auth token * Remove auth token * Try changes again * Add tests * Npm and GPR samples * Add types
This commit is contained in:
parent
0675b87d74
commit
78148dae50
391 changed files with 79848 additions and 43 deletions
59
node_modules/cross-spawn/lib/enoent.js
generated
vendored
Normal file
59
node_modules/cross-spawn/lib/enoent.js
generated
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
'use strict';
|
||||
|
||||
const isWin = process.platform === 'win32';
|
||||
|
||||
function notFoundError(original, syscall) {
|
||||
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
||||
code: 'ENOENT',
|
||||
errno: 'ENOENT',
|
||||
syscall: `${syscall} ${original.command}`,
|
||||
path: original.command,
|
||||
spawnargs: original.args,
|
||||
});
|
||||
}
|
||||
|
||||
function hookChildProcess(cp, parsed) {
|
||||
if (!isWin) {
|
||||
return;
|
||||
}
|
||||
|
||||
const originalEmit = cp.emit;
|
||||
|
||||
cp.emit = function (name, arg1) {
|
||||
// If emitting "exit" event and exit code is 1, we need to check if
|
||||
// the command exists and emit an "error" instead
|
||||
// See https://github.com/IndigoUnited/node-cross-spawn/issues/16
|
||||
if (name === 'exit') {
|
||||
const err = verifyENOENT(arg1, parsed, 'spawn');
|
||||
|
||||
if (err) {
|
||||
return originalEmit.call(cp, 'error', err);
|
||||
}
|
||||
}
|
||||
|
||||
return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
|
||||
};
|
||||
}
|
||||
|
||||
function verifyENOENT(status, parsed) {
|
||||
if (isWin && status === 1 && !parsed.file) {
|
||||
return notFoundError(parsed.original, 'spawn');
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function verifyENOENTSync(status, parsed) {
|
||||
if (isWin && status === 1 && !parsed.file) {
|
||||
return notFoundError(parsed.original, 'spawnSync');
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
hookChildProcess,
|
||||
verifyENOENT,
|
||||
verifyENOENTSync,
|
||||
notFoundError,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue