-
Notifications
You must be signed in to change notification settings - Fork 11
41 lines (41 loc) · 1.19 KB
/
Copy pathlivecheck.yml
File metadata and controls
41 lines (41 loc) · 1.19 KB
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
41
name: livecheck
on:
push:
pull_request:
schedule:
- cron: 34 5 * * *
workflow_dispatch:
inputs:
retry:
description: 'Retry attempt'
required: true
type: number
permissions: {}
jobs:
livecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
with:
ruby-version: '4'
bundler-cache: true
- env:
RETRY: ${{ inputs.retry }}
RETRIES: 3
GITHUB_TOKEN: ${{ secrets.RETRY_TOKEN }}
run: |
script/livecheck | tee -a "$GITHUB_STEP_SUMMARY" || {
exit_code=$?
if (( $exit_code == 2 )) && (( ${RETRY:-0} < $RETRIES )); then
sleep 300
gh workflow run "$GITHUB_WORKFLOW" --repo "$GITHUB_REPOSITORY" --ref "$GITHUB_REF_NAME" -f retry=$(( $RETRY + 1 ))
else
if (( $exit_code == 1 )); then
gh workflow run cache-downloads --repo "$GITHUB_REPOSITORY" --ref "$GITHUB_REF_NAME" -f retry=0
fi
exit $exit_code
fi
}