You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,18 +47,32 @@ To remove a public discussion:
47
47
## Getting started (development)
48
48
49
49
1. Clone this repo
50
-
2. Make sure to install Wrangler CLI: https://developers.cloudflare.com/workers/wrangler/get-started/
50
+
2. Make sure to install Wrangler CLI: https://developers.cloudflare.com/workers/wrangler/get-started/ and use `pnpm`
51
51
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.
52
52
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.
53
-
5. Run `npm install`
54
-
6. Run `npm start` for development.
53
+
5. Create `.dev.vars` file and add `NOTION_TOKEN` and `GH_BOT_TOKEN` to it (and other env vars if needed, see below)
54
+
6. Run `pnpm generate` to generate TypeScript types for the GraphQL queries.
55
+
7. Run `pnpm install`
56
+
8. Run `pnpm start` for development.
55
57
56
58
> We use Wrangler for the Worker development.
57
59
60
+
## Config
61
+
62
+
The following configurations can be set in the env of your project, in order to customize how the bot will run:
63
+
64
+
-`NOTION_TOKEN` - required, a Notion intergraion API key
65
+
-`GH_BOT_TOKEN` - requried (also during development)
66
+
-`DRY_RUN` - set to `1` if you wish to just test the create/update/delete plan of this bot, without affecting any data on GitHub.
67
+
-`ENABLE_FETCH` - Set to `1` to enable. This will enable the `fetch` event for the worker, this is helpful for development if you want to trigger the bot manually, or if you wish your bot to have a manual trigger.
68
+
-`CUSTOM_HEADER_LINK` - customize the link added to the header of every GitHub issue/discussion. To use an external like, you can add markdown, for example: `[The Guild's](https://the-guild.dev)`.
69
+
70
+
For local development, please add your config to a file called `.dev.vars`
71
+
58
72
## Deployment (as CloudFlare Worker)
59
73
60
74
- Every change to `main` branch will run CI and deploy to prod.
61
75
- Make sure to configure your `NOTION_TOKEN` and `GH_BOT_TOKEN` (PAT) as part of the env vars.
62
-
- You can also deploy from local env by running: `npm run deploy`
76
+
- You can also deploy from local env by running: `pnpm run deploy`
63
77
64
78
> If you wish to have a clone of your own, make sure to rename worker name in the `wrangler.toml` file
0 commit comments