Hi I am new in github actions and I am trying to create a CICD pipline using Github action. I am using a digital ocean droplet UBUNTU 20.04 as my server and I am trying to create a runner as said in ->settings->actions
When I wrote the following command
./config.sh --url https://github.com/basobaasnepal/BasobaasWeb --token DFGFSDF234sf3fg45hd
I got this: Must not run with sudo
I tried to change the from root user to non root user but didn't work. I also tried export {AGENT_ALLOW_RUNASROOT="1"}
but no luck there too.
The env variable to use is
RUNNER_ALLOW_RUNASROOT="1"
You can :export RUNNER_ALLOW_RUNASROOT="1"
RUNNER_ALLOW_RUNASROOT="1" ./config.sh --url...
At the beginning of
config.sh
you can see the following test :user_id=`id -u`
: Gets the uid of the current user and store it to user_id.$user_id -eq 0
: Compare it with 0 (0 is the uid of root).-a -z "$RUNNER_ALLOW_RUNASROOT"
:-a -z
Tests if the variable exists and is not empty.So in our case we could do
RUNNER_ALLOW_RUNASROOT="0"
or evenRUNNER_ALLOW_RUNASROOT="cool"
and it would work butRUNNER_ALLOW_RUNASROOT=""
would not work.I'm curious what was your issue when you tryed to run it as a non-root user ?