Skip to content

Run Email Notification on a CRON Schedule #712

Run Email Notification on a CRON Schedule

Run Email Notification on a CRON Schedule #712

name: Run Email Notification on a CRON Schedule
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
run_email_notification:
runs-on: ubuntu-latest
name: A job to run the email notification cron
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Email Notification Action Step
uses: ./email-notification
id: email-notification
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
JUNO_API_KEY: ${{ secrets.JUNO_API_KEY }}
JUNO_BASE_URL: ${{ secrets.JUNO_BASE_URL }}
JUNO_SENDER_EMAIL: ${{ secrets.JUNO_SENDER_EMAIL }}
JUNO_SENDER_NAME: ${{ secrets.JUNO_SENDER_NAME }}
keepalive-workflow:
name: Keepalive Workflow
runs-on: ubuntu-latest
permissions:
contents: write # allow branch creation & deletion
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Create, Push & Delete Dummy Branch
run: |
# Use run ID for a unique branch name each run
BRANCH="keepalive-${{ github.run_id }}"
# 1) Create new branch
git checkout -b $BRANCH
# 2) Make a dummy commit
echo "keepalive run ${{ github.run_id }} at $(date -u)" >> keepalive.txt
git add keepalive.txt
git commit -m "chore: keepalive commit ${{ github.run_id }}"
# Push the branch
git push origin $BRANCH
# 3) Delete it immediately
git push origin --delete $BRANCH