Skip to content

Cron Reminders

Cron Reminders #74

Workflow file for this run

name: Cron Reminders
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23) CST is -5 UTC #TODO: Daylight Savings Time
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: "55 16 * * 1" # Every Monday at 10:55 AM CT https://crontab.guru/
- cron: "25 22 * * 1" # Every Monday at 16:25 CT https://crontab.guru/
# TODO: Set up a single job that runs every hour between 9am and 9pm
# since the service will do nothing if there are no sessions in the given period
jobs:
info-session-reminder-hour-out:
permissions:
contents: "read"
id-token: "write"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: "auth"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCP_SA_CREDS_JSON }}"
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
# Using curl over "gcloud functions call" to specify the /notify endpoint
- id: "cloud-function-trigger-curl"
run: >
curl
--fail
-X POST
-H "Authorization: bearer $(gcloud auth print-identity-token)"
-H 'Content-Type: application/json'
-d '{"jobName":"info-session-reminder","jobArgs": {"period":"90 min"}}'
https://us-central1-operationspark-org.cloudfunctions.net/session-signups/notify