This is a Notion Integration to pick a next page at random for a Notion Database.
- click here to get a Notion API key.
- set environment value to each use case. below section is for local & GitHub Actions.
- confirm your Notion Database property setting. by default, it's defined constant values on
src/Config.ts
. if you wanna change key or value, you can change it. - confirm cron job setting. by default, it's defined constant expression values on
github/workflows/{chooseNext, watchDone, fetchIcon}.yaml
- chooseNext: '*/1 * * * *'
- watchDone: '*/10 * * * *'
- fetchIcon: '*/1 * * * *'
$ cp .env.example .env
- set each environmental value.
- fork or clone this repository.(highly recommend fork)
- move your repository Secrets settings and add your secret.
FYI: Encrypted secrets
sample images see below.
- get all pages from database
- group by status in use case
- if nobody empty Status, nothing to do
- randomly select one of the pages with empty Status and set its status to NEXT.
- get all pages from database
- group by status in use case
- if at least exist empty Status, nothing to do
- set all done pages status to empty
- get all pages from a database
- get icon url from a assign (person property type on Notion)
- set page cover with icon url