Skip to content

Commit 0f2883e

Browse files
authored
Merge pull request #250 from chantra/fix_ephemeral
Fix ephemeral support
2 parents dafb91b + 2fc9c11 commit 0f2883e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

entrypoint.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ _LABELS=${LABELS:-default}
2727
_RUNNER_GROUP=${RUNNER_GROUP:-Default}
2828
_GITHUB_HOST=${GITHUB_HOST:="github.com"}
2929
_RUN_AS_ROOT=${RUN_AS_ROOT:="true"}
30-
_EPHEMERAL=""
3130

3231
# ensure backwards compatibility
3332
if [[ -z $RUNNER_SCOPE ]]; then
@@ -62,6 +61,7 @@ case ${RUNNER_SCOPE} in
6261
esac
6362

6463
configure_runner() {
64+
ARGS=()
6565
if [[ -n "${ACCESS_TOKEN}" ]]; then
6666
echo "Obtaining the token of the runner"
6767
_TOKEN=$(ACCESS_TOKEN="${ACCESS_TOKEN}" bash /token.sh)
@@ -71,14 +71,12 @@ configure_runner() {
7171
# shellcheck disable=SC2153
7272
if [ -n "${EPHEMERAL}" ]; then
7373
echo "Ephemeral option is enabled"
74-
_EPHEMERAL="--ephemeral"
74+
ARGS+=("--ephemeral")
7575
fi
7676

7777
if [ -n "${DISABLE_AUTO_UPDATE}" ]; then
7878
echo "Disable auto update option is enabled"
79-
_AUTO_UPDATE="--disableupdate"
80-
else
81-
_AUTO_UPDATE=""
79+
ARGS+=("--disableupdate")
8280
fi
8381

8482
echo "Configuring"
@@ -91,8 +89,7 @@ configure_runner() {
9189
--runnergroup "${_RUNNER_GROUP}" \
9290
--unattended \
9391
--replace \
94-
"${_EPHEMERAL}" \
95-
"${_AUTO_UPDATE}"
92+
"${ARGS[@]}"
9693

9794
[[ ! -d "${_RUNNER_WORKDIR}" ]] && mkdir "${_RUNNER_WORKDIR}"
9895

0 commit comments

Comments
 (0)