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

provide an option to run without sudo #631

Open
christian-rauch opened this issue Nov 10, 2023 · 3 comments
Open

provide an option to run without sudo #631

christian-rauch opened this issue Nov 10, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@christian-rauch
Copy link

Description

Inside Docker containers, processes usually run as root. The action uses sudo to install packages via apt. This has two downsides:

  1. You may have to install sudo to make the action work.
  2. Since sudo runs without -E environment variables are not forwarded.

Completion Criteria

The action should provide two options:

  1. flag to select if actions should run with or without sudo
  2. parameter to provide additional command line argument to sudo, e.g. -E.

Testing Notes / Suggestions

Add an additional test where the action runs as root without sudo being installed.

@christian-rauch christian-rauch added the enhancement New feature or request label Nov 10, 2023
@christophebedard
Copy link
Member

You may have to install sudo to make the action work.

Can you share an example GitHub action config where this would be necessary? I'm guessing this is only if your own Docker image doesn't have sudo OR if you run your own runners(?).

@christian-rauch
Copy link
Author

Docker images without sudo are one issue. You can quickly check this with docker run --rm -ti ubuntu:22.04 bash -c "sudo apt update". This could be worked around by installing sudo in the image first, but it would still be nicer if you do not have to do this.

The main problem is that you cannot pass options to sudo, such as -E or --preserve-env.

@christophebedard
Copy link
Member

Sounds reasonable to me. A PR would be appreciated 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants