ruby / setup-ruby

An action to download a prebuilt Ruby and add it to the PATH in 5 seconds
https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
MIT License
788 stars 255 forks source link

Support non `runner` user on self-hosted runners #583

Closed fkorotkov closed 5 months ago

fkorotkov commented 5 months ago

Ensure the following before filing this issue

Are you running on a GitHub-hosted runner or a self-hosted runner?

self-hosted runner

Link to the failed workflow job (must be a public workflow job, so the necessary information is available)

https://github.com/cirruslabs/actions-playground/actions/runs/8781520697/job/24093712039

Any other notes?

Self-mosted macOS runners not always use runner as the user name. Right now runner user name is hard coded:

https://github.com/ruby/setup-ruby/blob/6bd3d993c602f6b675728ebaecb2b569ff86e99b/common.js#L267-L269

Can probably be fixed similar to https://github.com/actions/setup-python/pull/708

fkorotkov commented 5 months ago

Current workaround if you have "admin" user is to run the following first to pre-create /Users/runner:

- name: Ruby Workaround
  run: sudo mkdir -p /Users/runner && sudo chown -R admin:admin /Users/runner
eregon commented 5 months ago

See https://github.com/ruby/setup-ruby/pull/584#issuecomment-2068993404, it's not fixable.

eregon commented 5 months ago

Basically the same as https://github.com/actions/setup-python/pull/708#issuecomment-1653036504 actually