Skip to content

Snowy Owl Check

Snowy Owl Check #691

Workflow file for this run

name: Snowy Owl Check
on:
schedule:
# hourly 6am-6pm EST (11-23 UTC), Oct-Apr only
- cron: "0 11-23 * 1-4 *"
- cron: "0 11-23 * 10-12 *"
workflow_dispatch:
permissions:
actions: write
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: false
- run: uv sync
- name: Restore state cache
id: cache
uses: actions/cache/restore@v4
with:
path: .snowy-state.json
key: snowy-state
- name: Check for new sightings
env:
EBIRD_API_KEY: ${{ secrets.EBIRD_API_KEY }}
GMAIL_USER: ${{ secrets.GMAIL_USER }}
GMAIL_APP_PASSWORD: ${{ secrets.GMAIL_APP_PASSWORD }}
run: uv run snowy check --to "${{ vars.EMAIL_TO }}"
- name: Delete old state cache
if: steps.cache.outputs.cache-hit == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh cache delete snowy-state
- name: Save state cache
uses: actions/cache/save@v4
with:
path: .snowy-state.json
key: snowy-state