Skip to content

Commit

Permalink
Verify script is there before starting selfhosted runner
Browse files Browse the repository at this point in the history
  • Loading branch information
sounddrill31 authored Sep 21, 2024
1 parent a6b09c1 commit 86ecc0d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/force-restart-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ jobs:
# Start 'runner' in 'tmux'.
- name: Run crave devspace
run: |
echo "Looking for runner..."
# Look for whether there's a runner folder set up
if [ -f actions-runner/run.sh ] ; then
echo "Runner found! Restarting it..."
else
echo "Error! Runner not found!"
exit 1
fi
crave ${{ secrets.CRAVE_FLAGS }} devspace -- "tmux kill-session -t ghactions || true
tmux new-session -d -s ghactions
tmux send-keys -t ghactions './actions-runner/run.sh' Enter
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/selfhosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,16 @@ jobs:

- name: Run crave devspace
run: |
crave ${{ secrets.CRAVE_FLAGS }} devspace -- "if tmux has-session -t ghactions; then
crave ${{ secrets.CRAVE_FLAGS }} devspace -- "echo "Looking for runner..."
# Look for whether there's a runner folder set up
if [ -f actions-runner/run.sh ] ; then
echo "Runner found! Restarting it..."
else
echo "Error! Runner not found!"
exit 1
fi
if tmux has-session -t ghactions; then
echo "Runner is already Running"
else
tmux kill-session -t ghactions;
Expand Down

0 comments on commit 86ecc0d

Please sign in to comment.