Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to customize Runner PATH envvar without disregarding changes to system PATH envvar #3292

Open
BrianCArnold opened this issue May 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@BrianCArnold
Copy link

What would you like added?

Why is this needed?

Additional context

There are two initial solutions I can think of:

  1. Create a .env_parsed file that will replace any environment variables present to the right of an = with the value of that environment variable. (PATH=D:\actions-runner\tools;$PATH is mutated to PATH=D:\actions-runner\tools;C:\Windows\System32;C:\Win... before being

Describe the bug

Add the ability to specify a prepended or postpended set of directories to the existing PATH variable for the runner context.

To Reproduce

  1. Install GCC and Python on Windows
  2. Install the runner
  3. Add a utility in D:\actions-runner\tools solely for the use of the runner
  4. Customize the PATH in .env PATH=D:\actions-runner\tools;C:\Windows\System32;C:\Win...
  5. Install Perl

It is now necessary to manually add the new Perl path from the System-wide PATH variable to the PATH variable of the runner,

Expected behavior

It would be ideal to be able to specify additional directories that could be added to the PATH, rather than requiring that admins specify the exhaustive list of PATH directories.

Runner Version and Platform

Version of your runner?
2.316.1

OS of the machine running the runner?
Windows Server 2019 Standard

What's not working?

Can't add directories to PATH for runner without listing all directories from system PATH envvar.

Job Log Output

N/A

Runner and Worker's Diagnostic Logs

N/A

After reviewing the associated code that processes the .env file , I believe it would be quite simple to add code similar to the existing parsing of .env by parsing a secondary file (perhaps called .env_parsed and simply replace placeholders for existing envvars with their current value as each var is processed.

@BrianCArnold BrianCArnold added the bug Something isn't working label May 16, 2024
BrianCArnold added a commit to BrianCArnold/runner that referenced this issue May 16, 2024
…values to be used in calculating resultant envvar values for runner. Addresses actions#3292
BrianCArnold added a commit to BrianCArnold/runner that referenced this issue May 16, 2024
…values to be used in calculating resultant envvar values for runner. Addresses actions#3292
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant