AsesomeBot #900
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
push: | |
schedule: | |
- cron: '0 0 * * *' | |
name: AsesomeBot | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
env: | |
ASESOME_BOT_OPTION: --allow-redirect --allow-ssl --allow-dupe -t 60 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.6 | |
- name: install | |
run: gem install awesome_bot | |
- name: check | |
run: | | |
awesome_bot_with_retry() { | |
local attempt_max=5 | |
local -i attempt_num=1 | |
until awesome_bot "$@"; do | |
if ((attempt_num == attempt_max)); then | |
exit 1 | |
fi | |
echo "retry ${attempt_num}" | |
((attempt_num++)) | |
done | |
} | |
# shellcheck disable=SC2086 | |
awesome_bot_with_retry README.md ${ASESOME_BOT_OPTION} |