Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/monthly-export.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Monthly Export

on:
schedule:
- cron: '0 0 28-31 * *'
workflow_dispatch:

jobs:
export:
if: github.repository == 'texonom/notion-node'
runs-on: ubuntu-latest

steps:
- name: check last day
id: last
run: |
if [ $(date -d tomorrow +"%d") = "01" ]; then
echo "run=true" >> "$GITHUB_OUTPUT"
else
echo "run=false" >> "$GITHUB_OUTPUT"
fi

- uses: actions/checkout@v4
if: steps.last.outputs.run == 'true'

- name: Install Node.js
if: steps.last.outputs.run == 'true'
uses: actions/setup-node@v4
with:
node-version: 22.16.0

- name: Install dependencies
if: steps.last.outputs.run == 'true'
run: |
npm i -g pnpm
pnpm i --frozen-lockfile

- name: Export from Notion
if: steps.last.outputs.run == 'true'
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
PAGE_ID: ${{ secrets.NOTION_PAGE_ID }}
run: |
pnpm tsx packages/cli/src/main.ts export -p "$PAGE_ID" -r -l -t "$NOTION_TOKEN" -u

29 changes: 29 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release

on:
push:
tags:
- '*'

jobs:
run:
if: github.repository == 'texonom/notion-node'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22.16.0

- name: Install dependencies
run: |
npm i -g pnpm
pnpm i --frozen-lockfile

- name: Run release script
run: pnpm tsx release.ts --version=${{ github.ref_name }}