mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #1184] Support running an action as a non-root user #659
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#659
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @spkane on GitHub (May 26, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1184
Act version
act version 0.2.26
Feature description
Some things simply fail if you try to run them as root.
In my case I am installing Linuxbrew, to manage some additional software dependencies and it fails because it refuses to install when run as the root user.
It would be nice if the containers had another user, called something like
runnerornonprivthat could be used for a single action somehow when required.@jayvdb commented on GitHub (May 29, 2022):
I also ran into this, and here is my recipe, still a bit of a WIP trying to reach installation of
ktlint, and theif [ .. ]here is because I useact -r -j ...locally@ChristopherHX commented on GitHub (Sep 15, 2022):
Can anyone confirm if this is still a problem? Non root user container support should be available in the current version.
You now need to choose a non root user container:
act -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:runner-latestChange ubuntu-latest to the runs-on value you specified.
@jayvdb commented on GitHub (Sep 15, 2022):
I see the "runner" images are documented at https://github.com/catthehacker/docker_images , but not at https://github.com/nektos/act/blob/master/IMAGES.md and IMO the root/non-root distinction is worth mentioning at https://github.com/nektos/act/blob/master/README.md#runners
@alvis commented on GitHub (Mar 14, 2023):
@ChristopherHX I've tried
ubuntu:runner-20.04and it's working fine for me ✅@Stanzilla commented on GitHub (Apr 23, 2024):
It installs fine but the
brewcommand is not available afterwards:@ChristopherHX commented on GitHub (Apr 24, 2024):
I would expect that setup actions would install tools like brew and not assert that these has been preinstalled.
@ipatch commented on GitHub (Nov 8, 2024):
i ran into this issue yesterday regarding brew and was able to workaround it by updating the
PATHstored in theGITHUB_ENV. you should probably print the contents of theGITHUB_ENVto see if in fact homebrew paths were added thePATHenv var as for my setup I had to manually do this in my workflow file.@inkarkat commented on GitHub (Dec 16, 2024):
Why aren't the non-root
runner-images the default? Shouldn't it be the main goal to be as compatible with GitHub's workflows, and as those use a non-rootrunneruser, act should do the same?I have some Bats tests that attempt to write to a read-only directory, and expect this to fail. Except with act, the root user can still write even though permissions are
r-x------, causing the tests to fail.@ChristopherHX commented on GitHub (Dec 16, 2024):
Given this issue is still open, I assume this enhancement is not fully implemented. Or the original issue creator don't care about this topic enough to reply to my old comments.
If you would have chosen the large/xxl images then you are rootless by default.
The GitHub Actions Platform itself doesn't support rootless container at all, this applies to images provided inside workflows.
This is my opinion, a maintainer who haven't got any PR reviews for one and a half months as of today, merges are blocked by minimum review rules for non owners. I did review some third party PR's, but another inactive project member need to do it as well. A hard fork might be needed and more people working on the codebase. I'm interested in the non docker backend as this allows platform run actions that are not supported by official GitHub Actions
This goal failed by going with docker, those who have written this goal are inactive by now.
ubuntu-*VMchown -Rto avoid permission issues