Repository navigation
Trigger server to update cached data #3685
This file contains hidden or 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: Trigger server to update cached data | |
| on: | |
| schedule: | |
| # ┌───────────── minute (0 - 59) | |
| # │ ┌───────────── hour (0 - 23) | |
| # │ │ ┌───────────── day of the month (1 - 31) | |
| # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
| # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
| # │ │ │ │ │ | |
| # │ │ │ │ │ | |
| # │ │ │ │ │ | |
| # * * * * * | |
| - cron: "15,45 * * * *" | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| repeat-recent-requests: | |
| if: github.repository == 'stats-organization/github-stats-extended' | |
| name: Trigger server to update cached data. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Make Request | |
| run: | | |
| args=( | |
| --silent --show-error # no progress bar, but still report errors | |
| --request POST # the only thing the endpoint checks | |
| --location # a redirect would otherwise pass the status check | |
| --max-redirs 5 # bounded well below curl's default of 50 | |
| --speed-limit 1 --speed-time 300 # give up after 300s of no traffic | |
| --output response.txt # keep the body out of the status capture | |
| --write-out "%{http_code}" # status is all we capture on stdout | |
| ) | |
| status=$(curl "${args[@]}" "https://github-stats-extended.vercel.app/api/repeat-recent") | |
| cat response.txt | |
| printf '\nstatus: %s\n' "$status" | |
| test "$status" -lt 400 |