myoung34/docker-github-actions-runner

Feature request: Ability to set final RUNNER_WORKDIR (without _RUNNER_NAME suffix)

matejdro opened this issue · 3 comments

At the moment, this image will always add runner name to the workdir. This makes the workdir different between different runners.

Cache systems of some build tools (such as Gradle's configuration cache) depend on absolute path to the project being consistent. But with this forceful RUNNER_NAME suffix, we cannot restore cache between different runners, since path to the project will be different on different runners.

Any chance this behavior could be configured?

Thanks.

If you set RUNNER_WORKDIR this is not true

docker run ... -e RUNNER_WORKDIR=/tmp -e RUNNER_NAME=foo will result in /tmp
https://github.com/myoung34/docker-github-actions-runner/blob/master/goss_full.yaml#L9

Are you seeing something I'm not?

From what I can see, script will always create _RUNNER_WORKDIR from the RUNNER_WORKDIR variable, with extra name padded in:

_RUNNER_WORKDIR=${RUNNER_WORKDIR:-/_work/${_RUNNER_NAME}}

Ah nevermind, it appears that the : in bash is the fallback, I thought it was always appending it. Just learned about this operator today. Thanks!