This GitHub Action checks the status of Notion tasks associated with Pull Requests. It's designed to streamline the workflow between GitHub and Notion, ensuring that PR statuses align with their corresponding task statuses in Notion.
Note: This action is currently in development. Some properties are still hardcoded and need to be made configurable.
- Automatically checks Notion task status when a PR is opened, reopened, or updated
- Comments on PRs with the current Notion task status
- Supports multiple PRs in a single deployment (e.g., when merging
devintostaging)
-
Create a new repository for this action or clone this one.
-
Ensure you have Node.js installed (version 16 or later recommended).
-
Install dependencies:
npm install -
Build the action:
npm run build
To use this action in your workflow, add the following step to your .github/workflows/your-workflow.yml file:
- name: Check Notion PR Status
uses: high-country-dev/notion-pr-status-check-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
notion-token: ${{ secrets.NOTION_API_KEY }}
notion-database-id: ${{ secrets.NOTION_DATABASE_ID }}github-token: The GitHub token used to create comments on PRs. (Required)notion-token: Your Notion API key. (Required)notion-database-id: The ID of your Notion database containing the tasks. (Required)
-
In your GitHub repository, go to Settings > Secrets and add the following secrets:
NOTION_API_KEY: Your Notion API keyNOTION_DATABASE_ID: Your Notion database ID
-
The
GITHUB_TOKENis automatically provided by GitHub Actions.
- The action currently has some hardcoded properties that need to be made configurable:
- The Notion property name for task IDs (
bOh%7C) - The Notion property ID for QA status (
yNMG) - The format of task IDs in PR titles (
[MD-1234])
- The Notion property name for task IDs (
- Error handling and logging need to be improved for better debugging
- More comprehensive testing is needed
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
PRNUMBER=12 GITHUB_REPOSITORY=high-country-dev/farmers GITHUB_TOKEN=ghp**_ NOTIONTOKEN=secret_** NOTION_DATABASE_ID=*** pnpm -F scripts exec tsx src/notionPrStatusCheck.ts