2021-10-25 15:16:42 +00:00
|
|
|
name: Cron - downgradeUsers
|
|
|
|
|
|
|
|
on:
|
2023-03-28 19:38:01 +00:00
|
|
|
workflow_dispatch:
|
2021-10-25 15:16:42 +00:00
|
|
|
# "Scheduled workflows run on the latest commit on the default or base branch."
|
|
|
|
# — https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#schedule
|
|
|
|
schedule:
|
2023-03-28 19:38:01 +00:00
|
|
|
# Runs “Every month at 1st (see https://crontab.guru)
|
|
|
|
- cron: "0 0 1 * *"
|
2021-10-25 15:16:42 +00:00
|
|
|
jobs:
|
2022-07-04 23:36:38 +00:00
|
|
|
cron-downgradeUsers:
|
2021-10-25 15:42:16 +00:00
|
|
|
env:
|
|
|
|
APP_URL: ${{ secrets.APP_URL }}
|
|
|
|
CRON_API_KEY: ${{ secrets.CRON_API_KEY }}
|
2021-10-25 15:16:42 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: cURL request
|
2021-10-25 15:42:16 +00:00
|
|
|
if: ${{ env.APP_URL && env.CRON_API_KEY }}
|
2021-10-25 15:16:42 +00:00
|
|
|
run: |
|
|
|
|
curl ${{ secrets.APP_URL }}/api/cron/downgradeUsers \
|
2021-10-25 16:05:36 +00:00
|
|
|
-X POST \
|
2021-10-25 15:16:42 +00:00
|
|
|
-H 'content-type: application/json' \
|
|
|
|
-H 'authorization: ${{ secrets.CRON_API_KEY }}' \
|
|
|
|
--fail
|