actions / actions/setup-node

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

Open
#1,039 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
TypeScript
Stars
5k
Forks
1.7k
Avg merge
3d 12h
Merged PRs (30d)
2

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/main.ts and compare its run entry point with the linked setup-python implementation. Done means a non-empty AGENT_TOOLSDIRECTORY value is recognized so that RUNNER_TOOL_CACHE uses the same directory, with the behavior checked against the repository's existing validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, node.js, typescript
Domain
ci-cd, devops
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.