notion-github-sync
This bot syncs public Notion pages as GitHub Discussions/Issues. It's done periodically, based on the pages shared with the Notion Integration, and based on metadata specific on your Notion page.
Usage
To use this tool, please make sure to have the following:
- Deploy this tool or run it locally with the relevant env vars.
- Make sure to add the user your wish to use as collaborator in your repos (this is needed only in order to delete Discussions)
- To make a Notion page public and syncable, first make sure to share this page with the Notion Integration you created:

- If you wish to make the Notion page public (with the Notion url), also tick
Share to web
:

- Annotate the top of your Notion page with the repo you wish to sync the page with the following text (NOT as code block, just as text - this should be the first block of your Notion page):
/github-public dotansimha/test-notion-sync discussion
You can also specify a custom GitHub Discussion category (the default is General):
/github-public dotansimha/test-notion-sync discussion General
Or, as an issue:
You can also specify a custom GitHub Discussion category (the default is General):
/github-public dotansimha/test-notion-sync issue
You can find a synced example page here: dotansimha/test-notion-sync#12
To remove a public discussion:
- Make sure to delete the annotation from your page.
- Wait for the next sync (or, manually run it)
- You can also remove now the integration access from the page.
Getting started (development)
- Clone this repo
- Make sure to install Wrangler CLI: https://developers.cloudflare.com/workers/wrangler/get-started/
- Create a Notion integration and get your Notion token (see https://www.notion.so/my-integrations). Use the token as
NOTION_TOKEN
env var.
- Create a GitHub Personal Access token for the relevant user (to create/update/delete the GH Discussions). Use the token as
GH_BOT_TOKEN
env var.
- Run
npm install
- Run
npm start
for development.
Deployment (as CloudFlare Worker)
- Every change to
main
branch will run CI and deploy to prod.
- Make sure to configure your
NOTION_TOKEN
andGH_BOT_TOKEN
(PAT) as part of the env vars.
- You can also deploy from local env by running:
npm run deploy