mirror of
https://code.forgejo.org/actions/setup-node
synced 2025-06-19 18:10:26 +02:00
Merge c955c43bf4
into 802632921f
This commit is contained in:
commit
1b0247db41
9 changed files with 120 additions and 2 deletions
34
dist/setup/index.js
vendored
34
dist/setup/index.js
vendored
|
@ -100677,6 +100677,29 @@ class CanaryBuild extends base_distribution_prerelease_1.default {
|
|||
exports["default"] = CanaryBuild;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6572:
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.ignoreScriptsInNpmConfig = void 0;
|
||||
const fs_1 = __nccwpck_require__(7147);
|
||||
const util_1 = __nccwpck_require__(2629);
|
||||
const ignoreScriptsInNpmConfig = (ignore) => {
|
||||
const nonEmptyInput = (0, util_1.defaultIfEmpty)(ignore, 'false');
|
||||
const ignored = JSON.parse(nonEmptyInput);
|
||||
appendToNpmrc(ignored);
|
||||
};
|
||||
exports.ignoreScriptsInNpmConfig = ignoreScriptsInNpmConfig;
|
||||
const appendToNpmrc = (ignoreScripts) => {
|
||||
const npmrc = (0, util_1.getNpmrcLocation)();
|
||||
(0, fs_1.writeFileSync)(npmrc, `\nignore-scripts=${ignoreScripts}\n`, { flag: 'a' });
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 399:
|
||||
|
@ -100730,6 +100753,7 @@ const cache_utils_1 = __nccwpck_require__(1678);
|
|||
const installer_factory_1 = __nccwpck_require__(5617);
|
||||
const util_1 = __nccwpck_require__(2629);
|
||||
const constants_1 = __nccwpck_require__(9042);
|
||||
const ignore_scripts_1 = __nccwpck_require__(6572);
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
|
@ -100769,6 +100793,8 @@ function run() {
|
|||
if (registryUrl) {
|
||||
auth.configAuthentication(registryUrl, alwaysAuth);
|
||||
}
|
||||
const ignoreScripts = core.getInput('ignore-scripts');
|
||||
(0, ignore_scripts_1.ignoreScriptsInNpmConfig)(ignoreScripts);
|
||||
if (cache && (0, cache_utils_1.isCacheFeatureAvailable)()) {
|
||||
core.saveState(constants_1.State.CachePackageManager, cache);
|
||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||
|
@ -100852,7 +100878,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.unique = exports.printEnvDetailsAndSetOutput = exports.getNodeVersionFromFile = void 0;
|
||||
exports.defaultIfEmpty = exports.getNpmrcLocation = exports.unique = exports.printEnvDetailsAndSetOutput = exports.getNodeVersionFromFile = void 0;
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const exec = __importStar(__nccwpck_require__(1514));
|
||||
const io = __importStar(__nccwpck_require__(7436));
|
||||
|
@ -100950,6 +100976,12 @@ const unique = () => {
|
|||
};
|
||||
};
|
||||
exports.unique = unique;
|
||||
const getNpmrcLocation = () => {
|
||||
return path_1.default.resolve(process.env['RUNNER_TEMP'] || process.cwd(), '.npmrc');
|
||||
};
|
||||
exports.getNpmrcLocation = getNpmrcLocation;
|
||||
const defaultIfEmpty = (input, defaultValue) => input.length === 0 ? defaultValue : input;
|
||||
exports.defaultIfEmpty = defaultIfEmpty;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue