Skip to content

Commit 197a4f4

Browse files
authored
Update README.md
1 parent 0c0615d commit 197a4f4

File tree

1 file changed

+44
-7
lines changed

1 file changed

+44
-7
lines changed

README.md

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,55 @@
11
# notion-github-sync
22

3-
For more information about this bot and it's usage:
3+
This bot syncs public Notion pages as GitHub Discussions. It's done periodically, based on the pages shared with the Notion Integration, and based on metadata specific on your Notion page.
44

5-
https://www.notion.so/theguildoss/Build-in-public-fc7180f938454b818b4ef262610a78af
5+
## Usage
66

7+
To use this tool, please make sure to have the following:
78

8-
## Getting started
9+
1. Deploy this tool or run it locally with the relevant env vars.
10+
2. Make sure to add the user your wish to use as collaborator in your repos (this is needed only in order to delete Discussions)
11+
3. To make a Notion page public and syncable, first make sure to share this page with the Notion Integration you created:
12+
13+
![image](https://user-images.githubusercontent.com/3680083/177030441-7110357f-5f48-400e-b043-ed77fda794f1.png)
14+
15+
4. If you wish to make the Notion page public (with the Notion url), also tick `Share to web`:
16+
17+
![image](https://user-images.githubusercontent.com/3680083/177030470-bd8bafc5-a0ee-4c2e-920b-a7b3d2000483.png)
18+
19+
5. 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):
20+
21+
```
22+
/github-public dotansimha/test-notion-sync
23+
```
24+
25+
You can also specify a custom GitHub Discussion category (the default is General):
26+
27+
```
28+
/github-public dotansimha/test-notion-sync General
29+
```
30+
31+
You can find an synced example page here: https://github.com/dotansimha/test-notion-sync/discussions/12
32+
33+
34+
To remove a public discussion:
35+
36+
1. Make sure to delete the annotation from your page.
37+
2. Wait for the next sync (or, manually run it)
38+
3. You can also remove now the integration access from the page.
39+
40+
## Getting started (development)
941

1042
1. Clone this repo
1143
2. Make sure to install Wrangler CLI: https://developers.cloudflare.com/workers/wrangler/get-started/
12-
3. Run `npm install`
13-
4. Run `npm start` for development.
44+
3. Create a Notion integration and get your Notion token (see https://www.notion.so/my-integrations). Use the token as `NOTION_TOKEN` env var.
45+
4. 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.
46+
5. Run `npm install`
47+
6. Run `npm start` for development.
48+
49+
> We use Wrangler for the Worker development.
1450
15-
## Deployment
51+
## Deployment (as CloudFlare Worker)
1652

1753
- Every change to `main` branch will run CI and deploy to prod.
18-
- You can also deploy from local env by running: `npm run deploy`
54+
- Make sure to configure your `NOTION_TOKEN` and `GH_BOT_TOKEN` (PAT) as part of the env vars.
55+
- You can also deploy from local env by running: `npm run deploy`

0 commit comments

Comments
 (0)