Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 1.44 KB

ReadMe.md

File metadata and controls

49 lines (39 loc) · 1.44 KB

Notion2ReadMe

As an ironic matter of fact this readme is written manually and does not come from a Notion page.

Notion2ReadMe can be used as a Github Action to convert a Notion Page to a Github-readable ReadMe.md file containing subpages, code, links etc.

To use the Action just add the following YAML-File in the .github/workflows directory of your repository.

name: Notion2Readme

on:
  push:
    branches:
      - '*'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Notion2Readme
        uses: mcschmitz/notion2readme@main
        with:
          url: '<URL to Notion Page>'
        env:
          TOKEN_V2: ${{ secrets.token_v2 }}
      - name: Push Readme
        run: |
          git config user.name github-actions
          git config user.email [email protected]
          git add .
          git diff-index --quiet HEAD || git commit -m "NOTION2README"
          git push

This will execute the synchronization with Notion on every push to any branch. To change that you can define specific branches. To run the action you will have to add the token_v2 secret to your github repository. The token_v2 token can be obtained in any browser running an active Notion session (In Chome you can find it under Settings/Privacy and Security/Cookies and other side data). Please make sure, that the user linked to the token has access to the Notion Page you want to convert.