setup-node icon indicating copy to clipboard operation
setup-node copied to clipboard

Support env setting of AGENT_TOOLSDIRECTORY as in the setup-python action

Open catscanner opened this issue 1 year ago • 2 comments

Description: as in setup python

  if (IS_MAC) {
    process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
  }

  if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {
    process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
  }

  core.debug(
    `Python is expected to be installed into ${process.env['RUNNER_TOOL_CACHE']}`
  );

setup-node should read the AGENT_TOOLSDIRECTORY environment variable and if it exists, sets the RUNNER_TOOL_CACHE variable equal to it

A GitHub support agent said:

I was able to get this to work by forking actions/setup-node and copying the same implementation on actions/setup-python to allow support for AGENT_TOOLSDIRECTORY on my fork - essentially just throwing in those few lines where the run function is defined here.

Justification: Other actions already support this declaration and we need to use it to populate a caching system we are building to avoid hitting GitHub.com so often to install programming languages.

Are you willing to submit a PR? possibly, I will need to check schedule with our engineering team.

catscanner avatar May 09 '24 11:05 catscanner

Hello @catscanner, Thank you for creating this feature request and we will get back to you once we have some feedback on this :)

aparnajyothi-y avatar May 10 '24 08:05 aparnajyothi-y

Hi, I opened a PR for this, really appreciate if you could have a look, @aparnajyothi-y

th-le avatar May 10 '24 11:05 th-le