Skip to content

Commit

Permalink
Fix bug of failed to up self-hosted runner (#11)
Browse files Browse the repository at this point in the history
This commit is to fix the bug which be failed to up self-hosted runner,
because missing option of group setting.
  • Loading branch information
kuju63 authored Jan 31, 2022
1 parent 63951d3 commit 8718e23
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ ENV http_proxy="" \
owner="" \
repo_name="" \
runner_name="" \
label=""
label="" \
group=""

WORKDIR /actions-runner

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ This token is generated by github.
### label [Optional]

Labeled to Self-Hosted-runner. Details see [here](https://docs.github.com/en/actions/hosting-your-own-runners/using-labels-with-self-hosted-runners).

### group [Optional]

Add runner to specified self-hosted runner group. Self-hosted runner group is using Organization only.
10 changes: 9 additions & 1 deletion autoconf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,25 @@ if [ -z "${repo_name}" ]; then
exit 1
fi

local LABEL=""
LABEL=""

if [ -z "${label}" ]; then
LABEL=""
else
LABEL="${label}"
fi

if [ -z "${group}" ]; then
GROUP="Default"
else
GROUP="${group}"
fi

expect -c "
set timeout 10
spawn ./config.sh --url https://github.com/${owner}/${repo_name} --token ${TOKEN}
expect \"Enter the name of the runner group to add this runner to:\"
send \"${GROUP}\n\"
expect \"Enter the name of runner:\"
send \"${runner_name}\n\"
expect \"Enter any additional labels (ex. label-1,label-2):\"
Expand Down

0 comments on commit 8718e23

Please sign in to comment.