Sync markdown repository documentation to Notion
  • JavaScript 97.9%
  • Dockerfile 2.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2023-10-07 16:18:15 +03:00
.github/workflows Initial commit 2023-06-26 19:27:09 +03:00
.licenses/npm Initial commit 2023-06-26 19:27:09 +03:00
dist doc updates 2023-07-04 15:12:18 +03:00
.eslintrc.json lint 2023-06-27 16:23:17 +03:00
.gitattributes Initial commit 2023-06-26 19:27:09 +03:00
.gitignore first working proto 2023-06-27 01:53:08 +03:00
.licensed.yml Initial commit 2023-06-26 19:27:09 +03:00
action.yml updates 2023-06-28 22:50:32 +03:00
Dockerfile actions preparations 2023-06-27 17:29:58 +03:00
index.js doc updates 2023-07-04 15:12:18 +03:00
LICENSE Initial commit 2023-06-26 19:27:09 +03:00
package-lock.json try 2023-06-28 00:31:34 +03:00
package.json updates 2023-06-28 22:50:32 +03:00
README.md Update README.md 2023-10-07 16:18:15 +03:00

Sync repository documentation to Notion

  • markdown files sync supported only
  • autofix relative repository urls
  • syncs only updated documents
  • no images support for now (instead please use mermaid.js embeddable diagrams)
  • appends md5:hash to each document (to check for changes)

Inputs

All configuration are done with environmnent variables for compability with other ci's.

Outputs

Example usage

on:
  push:
    branches:
      - master
jobs:
  notion_sync:
    timeout-minutes: 10
    runs-on: [ubuntu]
    steps:
      - uses: actions/checkout@v3
      - name: sync repo docs to notions
        uses: pechorin/sync-repo-docs-to-notion@main
        env:
          NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
          NOTION_ROOT_PAGE_ID: https://www.notion.so/MyRootPage-jdskdjs8yd83dheeee
          FOLDER: "${{ github.workspace }}"
          RELATIVE_URLS_ROOT: "${{ github.server_url }}/${{ github.repository }}"
          IGNORE_CREATE_ERRORS: 1
          DEBUG: 1

or with manual launch:

on: workflow_dispatch

or launch only if any .md files changed:

on:
  push:
    branches:
      - master
jobs:
  notion_sync:
    timeout-minutes: 10
    runs-on: [ubuntu]
    steps:
      - uses: actions/checkout@v3
      - name: get changed files
        id: changed-files-specific
        uses: tj-actions/changed-files@v37
        with:
          files: |
            *.md
      - name: sync repo docs to notions
        if: steps.changed-files-specific.outputs.any_changed == 'true'
        uses: pechorin/sync-repo-docs-to-notion@main
        env:
          NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
          NOTION_ROOT_PAGE_ID: https://www.notion.so/MyRootPage-jdskdjs8yd83dheeee
          FOLDER: "${{ github.workspace }}"
          RELATIVE_URLS_ROOT: "${{ github.server_url }}/${{ github.repository }}"
          IGNORE_CREATE_ERRORS: 1
          DEBUG: 1

Warnings

  • Deletion is slow, if you changed a lot of documents it's easier to cleanup Notion first, and then run the action