This repository contains a Python script and GitHub Actions workflow designed to automatically export Notion notes and save them to this GitHub repository every hour. The automation ensures that your Notion notes are backed up and kept up-to-date in this repository without manual intervention.
- Automated Export: Uses GitHub Actions to run a Python script every hour to fetch and save Notion notes.
- Scheduled Updates: Regularly updates the repository with the latest notes from Notion.
- Automatic Commits: Commits and pushes changes to the repository to keep it synchronized with Notion.
This project uses GitHub Actions for automation, so no manual execution is required. Ensure the following:
-
Secrets Configuration: Add your Notion integration token, top page ID, and GitHub action token as GitHub repository secrets.
NOTION_TOKEN
: Your Notion API token.TOP_PAGE_ID
: The ID of the Notion page from which to start exporting.ACTIONS_TOKEN
: A token used for pushing changes.
-
Workflow Schedule: The GitHub Actions workflow is set to trigger every hour to fetch and save notes from Notion.
-
Workflow Permissions: Configure the workflow with Read and Write Permissions to ensure it can commit and push changes.
The workflow is defined in the .github/workflows/export-notion-notes.yml
file. It performs the following steps:
- Checkout the Repository: Check out the code from the repository.
- Set Up Python: Sets up the Python environment.
- Install Dependencies: Installs necessary Python packages.
- Export Notion Notes: Runs the
export_notion.py
script to fetch and save notes. - Commit and Push Changes: Commits the updated notes and pushes them to the repository.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch for your changes.
- Submit a pull request with a clear description of your modifications.
This project is licensed under the MIT License.
- GitHub Actions for CI/CD automation.
- Notion API for note management.