Open arp242 opened 2 years ago
Sorry for the trouble. but I would like to keep the current behavior. Running as a non-root user will cause more problems for normal users. but I will add this note in the Readme.
thanks
No worries.
I think changing the default would be a bad idea as it might break people's existing workflows, but would you accept a patch to add an option? with: {local-user: true}
or something?
but would you accept a patch to
Yes, of course, as long as we don't change the default behavior.
You can create a new user or do any other initializations in the onStarted.sh hook:
https://github.com/vmactions/freebsd-vm/blob/main/hooks/onStarted.sh
Right now the "run" part is always run as the root user; this is an issue because I want to test a case where the user doesn't have permission to a file, but root always has access so it fails.
Other CI runners (e.g. the ubuntu and macos ones provided by GitHub) run as a regular unprivileged user; so it's a bit inconsistent.
I fixed it in my CI with:
But it would probably be a good idea to do something like that by default; it took me quite a while to figure out why the tests were working locally but were failing on the CI 😅
This is also an issue with the NetBSD and OpenBSD VMs, but I didn't create an issue for those of them.