Skip to content

livecheck

livecheck #2247

Workflow file for this run

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 || {
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
}