Scheduled jobs #24435
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
name: 'Scheduled jobs' | |
on: | |
schedule: | |
# GitHub Actions' `cron` uses UTC, which, given daylight savings time, is | |
# pretty useless if one wants a consistent local starting time. Instead, | |
# we'll just run a Python script every hour and implement the schedule in | |
# that script. This also allows for things that aren't possible with a | |
# `cron` expression, like biweekly intervals. | |
# | |
# Additionally, GitHub documents that scheduled events can be delayed during | |
# periods of high load, or even skipped. To reduce the chances of these | |
# restrictions impacting our schedule, we run the script more than once per | |
# hour. | |
# | |
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
# | |
- cron: '3,23,43 * * * *' | |
jobs: | |
schedule: | |
runs-on: 'ubuntu-22.04' # has Python 3.10.12, which is fine for our purposes | |
permissions: | |
issues: 'write' | |
env: | |
# This must be a classic access token with `repo` scope so that it can | |
# create issues in the private `azul-private` repo. A fine-grained token | |
# didn't work at the time this comment was written. | |
# | |
GITHUB_TOKEN: '${{ secrets.AZUL_GITHUB_ACCESS_TOKEN_SCHEDULE_ACTION }}' | |
steps: | |
- uses: 'actions/checkout@v3' | |
with: | |
sparse-checkout: '.github' | |
- run: 'python3 .github/workflows/schedule.py' |