@@ -17689,6 +17689,15 @@ function run() {
1768917689 yield installer.pinNode(nodeVersion);
1769017690 }
1769117691 }
17692+ const npmVersion = core.getInput('npm-version', { required: false });
17693+ if (npmVersion !== '') {
17694+ core.info(`installing NPM ${npmVersion === 'true' ? '' : npmVersion}`);
17695+ yield installer.installNpm(npmVersion);
17696+ // cannot pin `npm` when `node` is not pinned as well
17697+ if (nodeVersion !== '' && hasPackageJSON) {
17698+ yield installer.pinNpm(npmVersion);
17699+ }
17700+ }
1769217701 const yarnVersion = core.getInput('yarn-version', { required: false });
1769317702 if (yarnVersion !== '') {
1769417703 core.info(`installing Yarn ${yarnVersion === 'true' ? '' : yarnVersion}`);
@@ -17747,7 +17756,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1774717756 return (mod && mod.__esModule) ? mod : { "default": mod };
1774817757};
1774917758Object.defineProperty(exports, "__esModule", ({ value: true }));
17750- exports.getVolta = exports.pinYarn = exports.pinNode = exports.installYarn = exports.installNode = exports.execVolta = exports.buildLayout = exports.buildDownloadUrl = void 0;
17759+ exports.getVolta = exports.pinYarn = exports.pinNpm = exports. pinNode = exports.installYarn = exports.installNpm = exports.installNode = exports.execVolta = exports.buildLayout = exports.buildDownloadUrl = void 0;
1775117760const core = __importStar(__webpack_require__(2186));
1775217761const tc = __importStar(__webpack_require__(7784));
1775317762const io = __importStar(__webpack_require__(7436));
@@ -17906,6 +17915,12 @@ function installNode(version) {
1790617915 });
1790717916}
1790817917exports.installNode = installNode;
17918+ function installNpm(version) {
17919+ return __awaiter(this, void 0, void 0, function* () {
17920+ yield execVolta(['install', `npm${version === 'true' ? '' : `@${version}`}`]);
17921+ });
17922+ }
17923+ exports.installNpm = installNpm;
1790917924function installYarn(version) {
1791017925 return __awaiter(this, void 0, void 0, function* () {
1791117926 yield execVolta(['install', `yarn${version === 'true' ? '' : `@${version}`}`]);
@@ -17918,6 +17933,12 @@ function pinNode(version) {
1791817933 });
1791917934}
1792017935exports.pinNode = pinNode;
17936+ function pinNpm(version) {
17937+ return __awaiter(this, void 0, void 0, function* () {
17938+ yield execVolta(['pin', `npm${version === 'true' ? '' : `@${version}`}`]);
17939+ });
17940+ }
17941+ exports.pinNpm = pinNpm;
1792117942function pinYarn(version) {
1792217943 return __awaiter(this, void 0, void 0, function* () {
1792317944 yield execVolta(['pin', `yarn${version === 'true' ? '' : `@${version}`}`]);
0 commit comments