Skip to content

Commit

Permalink
fix: removed deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehonal authored Feb 25, 2024
1 parent a2a0ea6 commit b2f5477
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
11 changes: 0 additions & 11 deletions src/defs.js

This file was deleted.

31 changes: 1 addition & 30 deletions src/prepare.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit b2f5477

Please sign in to comment.