Skip to content

Commit cd9e5f7

Browse files
committed
Update readme
1 parent 3d58b20 commit cd9e5f7

File tree

4 files changed

+77
-9
lines changed

4 files changed

+77
-9
lines changed

catalog-info.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
apiVersion: backstage.io/v1alpha1
22
kind: Component
33
metadata:
4-
name: notion-github-catalog
5-
description: A github action that synchronises a Github repo data, including Backstage definition file information, with a Notion database
4+
name: notion-azure-catalog
5+
description: A github action that synchronises a Azure subscription data with a Notion database
66
links:
77
- url: https://infinitaslearning.notion.site/Notion-Github-Catalogue-ac2395eda37144e698e6b8faef1003c7
88
title: Notion page
99
tags:
1010
- notion
11-
- github
11+
- azure
1212
- action
1313
spec:
1414
type: action
1515
lifecycle: production
1616
owner: opensource
17-
dependsOn:
18-
- notion-release-notes

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "notion-release-notes",
2+
"name": "notion-azure-catalog",
33
"version": "0.0.1",
44
"description": "",
55
"main": "index.js",

readme.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,71 @@
1-
# Notion Azure Catalog
1+
# Notion Azure Catalog
2+
3+
This action will scan all of the Azure subscritpions available to the provided token and update their information in the specified Notion database.
4+
5+
6+
## Notion integration and token
7+
8+
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'.
9+
10+
By default integrations cant access any content so you you *must* share your database (or the parent page / tree it is contained within) with the integration you created earlier to be able to access it.
11+
12+
## Notion Databases
13+
14+
This action expects a Notion database with the following properties, this will become the
15+
16+
- Name: text
17+
- URL: url
18+
- Type: select
19+
- ID: text
20+
- Location: select
21+
- Subscription: select
22+
- Updated: date
23+
- Hash: text
24+
25+
## Usage
26+
27+
This is typically deployed as a scheduled action:
28+
29+
```yaml
30+
name: AzureCatalog
31+
on:
32+
schedule:
33+
- cron: '30 5 * * *'
34+
workflow_dispatch:
35+
jobs:
36+
catalog:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Notion azure catalog
40+
uses: infinitaslearning/notion-azure-catalog@main
41+
with:
42+
notion_token: ${{ secrets.NOTION_TOKEN }}
43+
database: 2b26b4290cc84d95ad3e93c3255277a1
44+
subscription_filter: .*
45+
env:
46+
AZURE_CLIENT_ID: '${{ secrets.AZURE_CLIENT_ID }}'
47+
AZURE_TENANT_ID: '${{ secrets.AZURE_TENANT_ID }}'
48+
AZURE_CLIENT_SECRET: '${{ secrets.AZURE_CLIENT_SECRET }}'
49+
50+
51+
```
52+
53+
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 (but before the `?v=`) is the id, this works on both embedded and full page databases.
54+
55+
56+
## Azure Credentials
57+
58+
This expects a set of Azure environment credentials, easiest to get via: https://docs.microsoft.com/en-us/cli/azure/ad/sp?view=azure-cli-latest
59+
60+
```
61+
AZURE_CLIENT_ID=...
62+
AZURE_TENANT_ID=...
63+
AZURE_CLIENT_SECRET=...
64+
```
65+
66+
## Development
67+
68+
Assumes you have `@vercel/ncc` installed globally.
69+
After changes ensure you `npm run build`, commit and then submit a PR.
70+
71+
For the tests to run you need to have the environment variables set for GITHUB_TOKEN, NOTION_TOKEN and NOTION_DATABASE.

0 commit comments

Comments
 (0)