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

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

Open catscanner opened this issue 1 year ago • 1 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-java should read the AGENT_TOOLSDIRECTORY environment variable and if it exists, sets the RUNNER_TOOL_CACHE variable equal to it.

The logic is here: https://github.com/actions/setup-java/blob/a1c6c9c8677803c9f4bd31e0f15ac0844258f955/src/util.ts#L76

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 issue and we will get back to you once we have some feedback :)

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