GH notion
ActionsTags
(1)Sync your commits, branches and/or pull requests with an Notion issue.
The gh-notion tool allows you to seamlessly sync your GitHub commits, branches, and pull requests with a Notion issue. By automating this process, you can keep your Notion issue up to date with the latest changes in your GitHub repository.
Create a .github/workflow/{filename}.yml file with the following content:
name: GH to Notion
on:
push:
branches:
- main
- feature/**
- bugfix/**
- hotfix/**
pull_request:
types: [opened, reopened, closed]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: GH to Notion
uses: jlcaraballo/gh-notion@v1.0.3
env:
NOTION_STATUS: |
TODO=Not Started
PROGRESS=In Progress
DONE=Done
REVIEW=In review
MERGED=Staged
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NOTION_SECRET: ${{ secrets.NOTION_SECRET }}
NOTION_DATABASE: ${{ secrets.NOTION_DATABASE }}
-
Setting database code (Optional)
- Add property called "Code" with the formula ->
slice(id(), round(toNumber(replaceAll(id(), "[^0-9]", "")) % 4), 6)
- Add property called "Code" with the formula ->
-
Add properties type text (
Pull Requests,Branch,Commits) -
Add property type status (
Status) with the example following options:- Not Started
- In Progress
- Done
- In review
- Merged
- Add secret
NOTION_SECRETwith the value of the Notion integration secret. - Add secret
NOTION_DATABASEwith the value of the Notion database id.
To sync a branch with a Notion issue, follow one method below:
Add branch name to issue property Branch and create a git branch with the name of the property.
git checkout -b feature/my_branch
git push -u origin feature/my_branchNOTE: When you create a pull request with this branch, the property Pull Requests will be updated with the pull request url.
Write branch name including issue code "#{Code}_my_branch"
Example:
git checkout -b feature/#a2b3c4_my_branchWrite PR title including issue code "#{Code} My pull request"
Write commit message including issue code "#{Code} Commit message"
Example:
git commit -m '#a2b3c4 first commit'The status change in the following cases:
- When you create a branch and the status is
Not Startedthe status will be updated toIn Progress. - When you create a pull request the status will be updated to
In review. - When you merge a pull request the status will be updated to
Merged.
This project is licensed under the MIT License.
GH notion is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.