actions / actions/runner

Running an action via svc start doesn't update runners environment variables - causing failures on jobs

Open
#2,903 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

How to reproduce:

method 1:

  1. install and run self-hosted runner on a mac build machine (i.e. ./svc.sh install and ./svc.sh start`)
  2. Add some new items to your $PATH variable
  3. restart your runner so changes take effect with ./svc.sh stop and ./svc.sh start
  4. Run your job that requires the new PATH dependencies

Expected behaviour:
New variables added to path can now be accessed via the Action

Actual behaviour:
You'll get the same error as the path was not updated for some reason. But if you activate the runner via run.sh then the changes will take effect.

I've worked around this by manually editing the .paths file in actions-runner. But I recently tried the same with my homebrew installation and it isn't working even after updating the path. Is there a saved version of the .zshrc file within the actions-runner folder or something?

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 with the macOS service path using svc.sh install, svc.sh start, and svc.sh stop, then compare it with run.sh. Review how the runner uses the .paths file and whether .zshrc is involved. Done means newly added PATH entries are available to jobs after restarting the service, as they are when using run.sh.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, macos, zsh
Domain
ci-cd, devops, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.