Turning a week of GitHub activity into Notion blocks
Building in public should not require remembering to write anything down. Pull the week's GitHub activity and post it to Notion automatically.
Fetches pull requests, issues and gists for the past week and writes a summary to a Notion page. The work is entirely in the seam between two APIs that agree about nothing. GitHub offers three resources with three different idioms for filtering by date, a search qualifier, list-endpoint parameters with different semantics, and gists with neither, so “past week” is three queries with three boundary cases.
Notion is the harder half. Its API takes a block tree, not markdown, so a formatted summary has to be constructed as nested objects. Pasting markdown gets you a page containing the literal characters. Most of the code in a tool like this is that conversion, and nobody expects to write it.
Idempotency is the gap. Running twice in a week, or again after a partial failure, appends a second summary with nothing preventing it. A marker block or a deterministic per-week block ID fixes it; I assumed the schedule instead.