-
Notifications
You must be signed in to change notification settings - Fork 13
40 lines (40 loc) · 965 Bytes
/
livecheck.yml
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
36
37
38
39
40
name: livecheck
on:
push:
pull_request:
schedule:
- cron: 34 5 * * *
workflow_dispatch:
inputs:
retry:
description: 'Retry attempt'
required: true
type: number
jobs:
livecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3'
bundler-cache: true
- run: |
bundle exec script/livecheck || if (( $? == 1 )); then
exit 1
else
echo '::set-output name=RETRY::1'
fi
id: livecheck
- if: ${{ steps.livecheck.outputs.RETRY }}
env:
RETRY: ${{ inputs.retry }}
RETRIES: 10
GITHUB_TOKEN: ${{ secrets.RETRY_TOKEN }}
run: |
if (( ${RETRY:-0} < $RETRIES )); then
sleep 300
gh workflow run livecheck --repo $GITHUB_REPOSITORY --ref $GITHUB_REF_NAME -f retry=$(( $RETRY + 1 ))
else
exit 1
fi