Skip to content

Warning

You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

Notion github catalog

Actions
A github action that synchronises a Github repo data, including Backstage definition file information, with a Notion database
v0.2
Star (13)

Notion Github Catalog

This action will scan all of the Github repositories available to the provided token and update their information in the specified Notion database.

Notion integration and token

First, you need to have an integration access token - which you can get from https://www.notion.so/my-integrations after creating an integration. Give the integration a friendly name like 'Github Actions'.

By default integrations cant access any contentm so you you must share your database with the integration you created earlier to be able to access it!

Notion Database

This action expects a Notion database with the following properties:

  • Name: text
  • Description: text
  • Kind: select
  • URL: url
  • Segment: select
  • Team: select
  • Tags: multi_select
  • Visibility: select
  • Language: select
  • Status: select
  • Updated: date

It looks like this after it has run:

Screenshot 2021-12-19 at 12 55 39

Usage

This is typically deployed as a scheduled action:

name: Catalog
on:
  schedule:
    - cron:  '30 5 * * *'
  workflow_dispatch:
jobs:
  catalog:
    runs-on: ubuntu-latest
    steps:
     - name: Notion github catalog     
       uses: infinitaslearning/notion-github-catalog@main        
       with:          
         github_owner: infinitaslearning
         github_token: ${{ secrets.PAT_GITHUB_TOKEN }}
         notion_token: ${{ secrets.NOTION_TOKEN }}
         database: 2b26b4290cc84d95ad3e93c3255277a1    
         repository_type: all
         catalog_file: catalog-info.yaml

To get the database ID, simply browse to it, click on the '...' in Notion, and get a 'Copy link'. The GUID at the end of the URL is the id, this works on both embedded and full page databases.

Development

Assumes you have @vercel/ncc installed globally. After changes ensure you npm run build, commit and then submit a PR.

For the tests to run you need to have the environment variables set for GITHUB_TOKEN, NOTION_TOKEN and NOTION_DATABASE.

Notion github catalog is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

A github action that synchronises a Github repo data, including Backstage definition file information, with a Notion database
v0.2

Notion github catalog is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.