Weekly email service #78
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: Weekly email service | |
on: | |
schedule: | |
- cron: '0 20 * * 2' # UTC | Runs “At 7am on Wednesday.” UTC+11 | https://crontab.guru | |
workflow_dispatch: | |
inputs: | |
dry_run: | |
default: true | |
description: "Do not send emails" | |
type: boolean | |
env: | |
timezone: 'Australia/Melbourne' | |
TZ: 'Australia/Melbourne' | |
jobs: | |
github: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: Install dependencies | |
run: pip install . | |
- name: Place shopping list | |
run: | | |
echo '${{ secrets.SHOPPING_LIST }}' >> shopping-list.json | |
- name: Email comparisons | |
env: | |
MAILERSEND_API_KEY: ${{ secrets.MAILERSEND_API_KEY }} | |
FROM_ADDRESS: no-reply@${{ secrets.DOMAIN }} | |
run: | | |
python coles_vs_woolies email shopping-list.json --verbose \ | |
${{ (github.event_name == 'workflow_dispatch' && inputs.dry_run) && '--dry_run' || '' }} |