...
In your web browser, browse to your repository.
Go to Settings > Actions > Runners > New Self-Hosted Runner.
It will give you a series of commands to paste into the terminal. Instead of pasting them into the terminal, do this:
Find the line that says "./config.sh --url=..."
Get the URL and the token.
Read the URL to ensure it's a specific repository, not the organization or whatever.
Run this script as root. The script installs the runner, creates the service, and launches the service as the service account. It records the URL of which repository it's working for, in the service account's home directory under "actions-runner-url.txt":
Code Block # Optionally, if you need your runner to have any custom label, you may specify --labels= /root/bin/create-gitrunner.sh username GithubRepositoryURL token [--labels=foobarlabel]
Browse back to Actions > Runners, and confirm the new runner appears there, with a green Status, and Idle.
Removing a private runner
If you installed a runner as above and need to remove it:
Login as root
Code Block cd ${service_user}/actions-runner ./svc.sh uninstall rm -rf ${service_user}/actions-runner
Look in ${service_user}/actions-runner-url.txt
Browse to that repository > Settings > Actions > Runners, and force-remove the runner.
Finally
rm ${service_user}/actions-runner-url.txt