Git Product home page Git Product logo

Comments (3)

rwjblue avatar rwjblue commented on July 1, 2024

I'm not familiar with ec2-runners here, is that something you've setup in your organization?

from action.

rwjblue avatar rwjblue commented on July 1, 2024

This might ultimately be something we need to tweak in Volta itself. As long as someone makes sure that $PATH is updated we don't really care if we could edit your profile (bash/fish/zsh/etc).

We might be able to add a flag to volta setup for that, but we'd need to consider the pros/cons specifically.

from action.

rwjblue avatar rwjblue commented on July 1, 2024

Hmm. We might be able to avoid this error in the action itself if we setup VOLTA_HOME on $PATH first:

https://github.com/volta-cli/volta/blob/75581e5e8c36b58fa88557cfd4d01440fa1fd9ad/src/command/setup.rs#L46-L57

Basically, this would mean either changing setupVolta to always pass PATH as well as VOLTA_HOME:

action/src/installer.ts

Lines 297 to 310 in d253558

async function setupVolta(version: string, voltaHome: string): Promise<void> {
if (voltaVersionHasSetup(version)) {
const executable = path.join(voltaHome, 'bin', 'volta');
core.info(`executing \`${executable} setup\``);
await exec(executable, ['setup'], {
env: {
// VOLTA_HOME needs to be set before calling volta setup
VOLTA_HOME: voltaHome,
},
});
} else {
await buildLayout(voltaHome);
}
}

Or calling .addPath before calling voltaSetup (though it would take a bit of reworking to actually handle correctly):

action/src/installer.ts

Lines 386 to 409 in d253558

if (voltaHome === '') {
// download, extract, cache
const toolRoot = await acquireVolta(version, options);
// Install into the local tool cache - node extracts with a root folder
// that matches the fileName downloaded
voltaHome = await tc.cacheDir(toolRoot, 'volta', version);
await setupVolta(version, voltaHome);
core.info(`caching volta@${version} into ${voltaHome}`);
} else {
core.info(`using cached volta@${version}`);
}
// prepend the tools path. instructs the agent to prepend for future tasks
if (voltaHome !== undefined) {
const binPath = path.join(voltaHome, 'bin');
core.info(`adding ${binPath} to $PATH`);
core.addPath(binPath);
core.exportVariable('VOLTA_HOME', voltaHome);
}

🤔

from action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.