From b2f5477bbce3e927d59941f4d8886cc44007b515 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sun, 25 Feb 2024 11:44:26 +0100 Subject: [PATCH] fix: removed deprecated code --- src/defs.js | 11 ----------- src/prepare.js | 31 +------------------------------ 2 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 src/defs.js diff --git a/src/defs.js b/src/defs.js deleted file mode 100644 index 0b762e1..0000000 --- a/src/defs.js +++ /dev/null @@ -1,11 +0,0 @@ -const NPM_GLOBAL_DIR = '/home/runner/.npm-global'; - -const env = { - ...process.env, - PATH: `${NPM_GLOBAL_DIR}/bin:${process.env.PATH}`, -}; - -module.exports = { - env, - NPM_GLOBAL_DIR, -}; diff --git a/src/prepare.js b/src/prepare.js index 8b72a73..950ed19 100644 --- a/src/prepare.js +++ b/src/prepare.js @@ -1,44 +1,15 @@ const child_process = require("child_process"); const { step } = require(`../src/helpers`); -const { NPM_GLOBAL_DIR, env } = require(`../src/defs`); -const actionRootDir = `${__dirname}/../`; const cwd = process.env.GITHUB_WORKSPACE; module.exports = async function () { - /** - * Installing action dependencies before executing any actions - */ - step("NPM Dir change", () => { - child_process.execSync(`mkdir -p ${NPM_GLOBAL_DIR}`, { - stdio: [0, 1, 2], - cwd, - }); - child_process.execSync(`npm config set prefix '${NPM_GLOBAL_DIR}'`, { - stdio: [0, 1, 2], - cwd, - }); - child_process.execSync(`echo "${NPM_GLOBAL_DIR}/bin" >> $GITHUB_PATH`); - }); - - // make sure that node_modules are installed - // step('Npm action modules install', () => { - // child_process.execSync('npm install --omit=dev', { - // stdio: [0, 1, 2], - // cwd: actionRootDir, - // env, - // }); - // }); - const { npmVersionCheck, getNpmVersion } = require(`../src/utils`); - const core = require("@actions/core"); - // set new npm dir in pipeline paths - core.addPath(`${NPM_GLOBAL_DIR}/bin`); const npmVersion = getNpmVersion(); if (npmVersion) { - step("NPM upgrade", () => { + step("NPM setup specific version", () => { child_process.execSync(`npm install -g npm@${getNpmVersion()}`, { stdio: [0, 1, 2], cwd,