This action uploads the content of a provided Markdown file (e.g. Readme file) to a Notion page.
Notion integration token. Access here to get your own token. Don't forget to give your token access to the page.
Id of the Notion Page to be edited. This id is par of the URL of the page (notion.so/blah-blah-blah-<page_id>
)
Path to the Markdown file
Static content added before the Markdown content
Static content added after the Markdown content
Set in your GitHub repository Settings > Secrets (Actions) a secret NOTION_TOKEN
with your Integration Token from Notion and NOTION_PAGE_ID
with the id of your Notion Page. Don't forget to give your token access to the page..
Create the file .github/workflows/main.yml
with the following content:
name: Main Workflow
on:
workflow_dispatch: # Allow manual trigger
push:
branches:
- 'master'
paths:
- './README.md'
jobs:
hello_world_job:
runs-on: ubuntu-latest
name: Checkout and upload Readme to Notion
steps:
- name: checkout
uses: "actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b"
- name: Upload to Notion
uses: agonzalezl/readme-to-notion-action@88b6cb8eea354ac61c589f540e40cacadf0c8ecb
with:
static-top-text: '_This documentation is self-generated and will be overwritten. Please do not edit it manually._'
static-bottom-text: '_This documentation is self-generated and will be overwritten. Please do not edit it manually._'
file-path: './README.md'
notion-token: ${{ secrets.NOTION_TOKEN }}
notion-page-id: ${{ secrets.NOTION_PAGE_ID }}
Read more here about why to use commit hash instead of version in Github actions.
After creating a token in my-integrations, in your Notion page click Share
, click in the invite
search box and search for the name of your integration.
Thanks to Notion for continuing to make cool stuff 💜
Notion SDK for JavaScript makenotion/notion-sdk-js.
Martian: Markdown to Notion Parser tryfabric/martian.