Hello, is there any easy way to change to unprivileged user on Windows runner? Looking into GitHub Actions docs I wasn’t able to find out anything.
Do you use self-hosted runner or GitHub hosted runner?
Hosted Windows virtual machines are configured to run as administrators with User Account Control (UAC) disabled. If you use self-hosted runner, when you configure the runner , use an non-admin user when configure it run as service.
Would you mind telling the reason why you need to use non-admin user?
We use hosted virtual machines. Related discussion is at https://github.com/rubygems/rubygems/pull/3528#issuecomment-616162409. Contributor/dev usually uses Windows standard setup (which is IMHO UAC enabled, non-admin account) and for those we have found out current test suite is broken. It was fixed manually for now. Anyway it would be great to ensure we will not re-introduce any similar problem in the future.
There is no method to use windows runner as a non-admin user . If it is suitable for you to run your job in docker container, you could add option: --user 1001 under container keyword.
For detail info, please refer to a previous ticket: https://github.community/t5/GitHub-Actions/How-to-run-action-as-a-non-root-user/td-p/45561
+1 for easily running as a non-admin user. This makes it difficult to run PostgreSQL as a subprocess, since it checks whether the account is an admin. See https://github.com/zombiezen/postgrestest/runs/962052657 for an example failure.