Skip to content

Commit b0c0f87

Browse files
committed
Check if runner and state directory exist
1 parent 51ab3de commit b0c0f87

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

github_actions_runner_manager.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ start () {
1414
local state_path="$2"
1515
local force=$3
1616

17+
# check if the runner path exists
18+
if ! [[ -d "$runner_path" ]]
19+
then
20+
echo "Runner path not found"
21+
exit 2
22+
fi
23+
1724
if [[ -f $state_path/$PID_FILE ]]
1825
then
1926
# the runner is presumably already running
@@ -26,6 +33,8 @@ start () {
2633
fi
2734
fi
2835

36+
mkdir -p "$state_path"
37+
2938
# running as a service, see https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/configuring-the-self-hosted-runner-application-as-a-service
3039
echo "Starting runner"
3140
echo "Starting runner on $(hostname)" >>$state_path/$LOG_FILE

0 commit comments

Comments
 (0)