Github tool for listing some of your activity inside a database of Notion, made it with Typescript and I was inspired by this glitch code, thanks a lot Notion team !
- Have a Notion integration and retrieve the API KEY of it.
- Create a github API key, you can follow this tutorial, it's pretty easy
- Retrieve your ID of your issues database and put all 3 keys in a
.env
file like this :GITHUB_KEY=<GITHUB KEY> NOTION_KEY=<NOTION KEY> NOTION_DATABASE_ID_ISSUES=<ID HERE> NOTION_DATABASE_ID_PR=<ID HERE>
- Don't forget to have a version of Node later than 16.
- And also, don't forget to share your database to your Notion integration 😆 (got to do this mistake so many times)
Now the requirements are done, you just have to do these things :
- Install typescript environment :
npm install -g typescript
npm install -g ts-node
npx tsc --init
- Run
npm install
- And then you're good to go :
npm run dev
on your local environmentnpm start
if you want to init a pm2 job running this script every 6 hours
Setting up on pm2
while running npm start
and this will run a cron job every 6 hours thanks to node-cron module
For now it is just issues and PRs activity but in the future, I will make more features available