Skip to content

brianlovin/github-stars-notion-sync

Repository files navigation

Screen Shot 2026-05-22 at 16 11 18@2x

GitHub Stars → Notion

Sync your GitHub starred repos into a Notion database. Every starred repo becomes a Notion page with rich metadata (description, stars, topics, languages, license, owner avatar) and the README rendered into the page body — fully searchable inside Notion. A daily delta sync picks up newly-starred repos automatically.

The worker also exposes two tools so a Notion AI agent can star and unstar repos on your behalf — useful for prompts like "unstar every archived repo" or "unstar all repos from owner X".

Runs on Notion Workers — no server, no cron.

Setup

Install the Notion CLI:

curl -fsSL https://ntn.dev | bash
ntn login

Clone and run setup:

git clone https://github.com/brianlovin/github-stars-notion-sync.git
cd github-stars-notion-sync && npm install && npm run setup

Setup asks for a Notion Personal Access Token, walks you through registering a GitHub OAuth app, creates the GitHub Stars database (with views for All Repos / Active / Archived / By Owner / By Language), deploys the worker, then runs an initial backfill of every starred repo.

For the GitHub OAuth app at github.com/settings/applications/new, the only field that matters is the Authorization callback URL: https://www.notion.so/workers/oauth/callback.

Worker tools

After deploy, two tools are available to any Notion AI agent connected to the worker:

  • Star a GitHub repository — adds a star
  • Unstar a GitHub repository — removes a star

Pair the agent with the GitHub Stars database and try prompts like:

  • "Unstar every repo where Archived is true."
  • "Unstar all repos from owner {owner}."
  • "Star {owner/repo}."

The agent finds candidates in Notion and calls the tools. Each action goes through GitHub's API using the same OAuth grant the sync uses.

Maintenance

npm run backfill                              # idempotent full re-sync
npm run dedup                                 # archive duplicate rows (recovery only)
ntn workers sync trigger githubStarsDelta     # force a delta sync now
ntn workers sync status                       # health check
ntn workers runs list                         # recent runs + audit detail

Change schedule: "1d" in src/index.ts (valid 5m7d) and run ntn workers deploy to adjust the cadence.

Development

npm run check    # type-check (no emit)
npm test         # unit tests (~200ms, no network)

License

MIT — see LICENSE.

About

Sync your GitHub starred repos into Notion

Resources

License

Stars

Watchers

Forks

Contributors