github-actions-runner-container
github-actions-runner-container copied to clipboard
Allow spaces for Runner Groups and Work Directory
Hello👋 . I noticed that Runner Groups and Work Directory do not work well with spaces. This PR intends to fix them, though it would not be a significant scenario...
Change
- Add quotes to the arguments for
./config.shcall.
Testing
- Tested with
Sample Group 1anddummy diron GitHub Enterprise Server.
After Change
$ docker build -f redhat-ubi8-actions-runner/Dockerfile -t redhat-ubi8-actions-runner \
--build-arg "GH_RUNNER_VERSION=2.289.2" \
--no-cache .
$ docker run -d \
-e "GITHUB_SERVER=$GITHUB_SERVER" \
-e "RUNNER_ORGANIZATION_URL=$RUNNER_ORGANIZATION_URL" \
-e "RUNNER_WORK_DIRECTORY=dummy dir" \
-e "GITHUB_TOKEN=$GITHUB_TOKEN" \
redhat-ubi8-actions-runner
0a3594c1d486bf4bc0ae7d0d6b725e4fb5115946c01fdf44690037d1d5274532
$ docker exec -it 0a3594c1d486 ls "dummy dir"
_PipelineMapping _actions _temp _tool actions-sample

Before Change
$ docker run -d \
-e "GITHUB_SERVER=$GITHUB_SERVER" \
-e "RUNNER_ORGANIZATION_URL=$RUNNER_ORGANIZATION_URL" \
-e "GITHUB_TOKEN=$GITHUB_TOKEN" \
-e "RUNNER_WORK_DIRECTORY=dummy dir" \
-e "RUNNER_GROUP=Sample Group 1" \
redhat-ubi8-actions-runner
e9749f40ed535981fcd1ce2d290539fa0700cf559377c62addd9900a1fdc2439
group name identification failed
$ docker logs e9749f40ed535981fcd1ce2d290539fa0700cf559377c62addd9900a1fdc2439
...
Could not find any self-hosted runner group named "Sample".
name after space was cut off (becomes "dummy" instead of "dummy dir")
$ docker exec -it 574cdead4915 /bin/bash
[actions@574cdead4915 ~]$ ls
_diag bin config.sh dummy entrypoint.sh env.sh externals run-helper.cmd.template run-helper.sh.template run.sh runsvc.sh safe_sleep.sh svc.sh