https://github.com/tryfabric/markdown-to-notion
A GitHub Action that lets you upload a Markdown file to a Notion page
https://github.com/tryfabric/markdown-to-notion
actions github github-actions markdown notion notion-api notion-blocks
Last synced: about 1 month ago
JSON representation
A GitHub Action that lets you upload a Markdown file to a Notion page
- Host: GitHub
- URL: https://github.com/tryfabric/markdown-to-notion
- Owner: tryfabric
- License: mit
- Created: 2022-04-19T17:34:36.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-05T16:43:46.000Z (about 3 years ago)
- Last Synced: 2025-03-28T21:42:47.734Z (about 2 months ago)
- Topics: actions, github, github-actions, markdown, notion, notion-api, notion-blocks
- Language: TypeScript
- Homepage:
- Size: 351 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Markdown to Notion
Load a Markdown file into Notion with GitHub Actions.
## How does it work?
This action will read your Markdown file and convert it to Notion blocks using [`martian`](https://github.com/instantish/martian).
It will then append a synced block to your page containing the result of the conversion.
By default, the action will delete the first synced block it'll find in the page: this way it's able to quickly update your page without causing duplicates. Please keep in mind that you're not supposed to add other blocks to the page, otherwise the action may not work properly.## Inputs
```yaml
- uses: tryfabric/markdown-to-notion@v1
with:
# The local path of the Markdown file to load.
file: ./your/file.md# The token to use to access the Notion API. See the "How do I get a token?" FAQ for more info.
notion_token: ${{ secrets.YOUR_INTEGRATION_TOKEN }}# The ID of the page you want the file loaded into. See the "How do I find the page ID?" FAQ for more info.
notion_id: YourPageID# Whether to delete the existing block.
# Default: true
delete_existing: false
```## Outputs
The action provides these outputs:
- `block_id`: the ID of the new block that has been appended.
For more info on how to use outputs, see the [`steps` context docs](https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context).
## FAQs
### How do I get a token?
[Create a new intergration](https://www.notion.so/my-integrations) and save its token to a [new repository secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository).
Share your page with your integration and update your workflow to use the secret.### How do I find the page ID?
Go to your page in Notion, then look at the URL. Notion URLs are formatted like this:
```none
https://notion.so/-
https://notion.so/-#
```Both `` and `` (when present) are dash-less UUIDv4 strings, here's an example: `17e70ad9dc1941adbd2d19155fc4ac8f`.
To get the page ID, simply copy the first ID in the URL.```none
https://notion.so/title-01ff8594fa8a4fb192cf017f8fdbf8d4
-> ID: 01ff8594fa8a4fb192cf017f8fdbf8d4https://notion.so/othertitle-d673994443b34640a1768ac23cc202e2#49fc54c8af564f8cb052ce34fb590809
-> ID: d673994443b34640a1768ac23cc202e2
```---
Build with :blue_heart: by the team behind [Fabric](https://tryfabric.com).