-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (28 loc) · 1001 Bytes
/
main.yml
File metadata and controls
35 lines (28 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: MacoX-MD Bot Loop Runner
on:
workflow_dispatch:
jobs:
loop-task:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install Dependencies
run: npm install
- name: Run Bot (loop & auto-restart if crash)
run: |
echo "Running MacoX-MD bot in auto-restart mode..."
timeout 18000 bash -c 'while true; do node mavlin.js || echo "Bot crashed, restarting..."; sleep 2; done'
- name: Re-Trigger Workflow
if: always()
run: |
echo "Re-running workflow..."
curl -X POST \
-H "Authorization: Bearer ${{ secrets.MACODER_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/loop-runner.yml/dispatches \
-d '{"ref":"main"}'