This Notion integration syncs GitHub Pull Requests for a specific repo to a Notion Database. This integration was built using this database template and GitHub's Octokit Library. Changes made to pull requests in the Notion database will not be reflected in GitHub. For an example which allows you to take actions based on changes in a database go here.
-
Duplicate this template into your notion workspace:
-
You can create your Notion API key here.
-
Make sure you share the local copy of the template created in Step 1 with the integration created in Step 2
-
You can create your GitHub Personal Access token by following the guide here
-
You can find the Notion database id of the page you have created using these instructions
-
Create an action yaml file with the following contents and with the corresponding values filled in and push it in
root_path/.github/workflows
folder of your reponame: Sync Github Prs to Notion on: issues: types: [opened, edited, deleted, transferred, pinned, unpinned, closed, reopened, assigned, unassigned, labeled, unlabeled, locked, unlocked, milestoned, demilestoned] pull_request: types: [assigned, unassigned, labeled, unlabeled, opened, edited, closed, reopened, synchronize, converted_to_draft, ready_for_review, locked, unlocked, review_requested, review_request_removed, auto_merge_enabled, auto_merge_disabled] jobs: sync: runs-on: ubuntu-latest steps: - name: Sync Github PRs to Notion uses: sivashanmukh/[email protected] with: notionKey: <generated in step 2> notionDatabaseId: <found in step 5> githubKey: <generated in step 4>
# Clone this repository locally
git clone https://github.com/sivashanmukh/github-notion-pr-sync
# Install the dependencies
npm install
GITHUB_KEY=<your-github-personal-access-token>
NOTION_KEY=<your-notion-api-key>
NOTION_DATABASE_ID=<notion-database-id>
GITHUB_REPO_OWNER=<github-owner-username>
GITHUB_REPO_NAME=<github-repo-name>
You can create your Notion API key here.
You can create your GitHub Personal Access token by following the guide here.
To create a Notion database that will work with this example, duplicate this empty database template.
node index.js