mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-20 04:45:11 -05:00
The three GitHub Actions workflows that synced newsletter posts from
Buttondown previously called .github/scripts/sync_newsletter.py with a
bare `pip install requests`. They now install the news CLI's
requirements and call `news pull`.
- sync-newsletter.yml (daily scheduled sync)
- site-publish-live.yml (pre-build sync for live site)
- site-preview-dev.yml (pre-build sync for dev preview)
Ports the production-grade logic from the old script into
cli/commands/pull.py:
- HTML body handling (wrap in ```{=html}``` block for Quarto)
- Auto-categorization based on subject keywords
- Guest author detection ("Written by X" pattern)
- Skip Buttondown placeholder images (image-generator.buttondown.email)
- Incremental sync with early termination after 3 consecutive unchanged
- _stats.yml generation (issue count + subscriber count)
- --no-stats flag for runs that should not update the counter
Delete .github/scripts/sync_newsletter.py — the CLI is now the single
source of truth. No other callers.