guanghulab/.github/archived-workflows/notion-page-reader.yml
Guanghu Domestic Migration d1e47f4565
Some checks are pending
自动更新代码和重启 / update-and-restart (push) Waiting to run
CI检查 + 自动部署 / check (push) Waiting to run
CI检查 + 自动部署 / deploy (push) Blocked by required conditions
重启聊天服务 / restart (push) Waiting to run
chore: import sanitized domestic snapshot for REPO-002
Source snapshot: ca48d3ddf926d79aa138306164169baf764bb829
2026-07-17 15:54:41 +08:00

65 lines
2.3 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ═══════════════════════════════════════════════
# 🔺 Sovereign: TCS-0002∞ | Root: SYS-GLW-0001
# 📜 Copyright: 国作登字-2026-A-00037559
# ═══════════════════════════════════════════════
name: 铸渊 · Notion 页面阅读器
# 从 Notion 页面链接读取内容,输出 Markdown 格式文本
# 支持保存到文件并提交到仓库
#
# 依赖 Secrets
# NOTION_API_TOKEN Notion API token
#
# dispatch payload / inputs
# notion_page_url Notion 页面链接或页面 ID
# save_to_repo 是否保存到仓库true/false默认 false
on:
repository_dispatch:
types: [read-notion-page]
workflow_dispatch:
inputs:
notion_page_url:
description: 'Notion 页面链接或页面 ID'
required: true
save_to_repo:
description: '保存到仓库 data/notion-pages/ 目录true/false'
required: false
default: 'false'
jobs:
read-page:
name: 📖 读取 Notion 页面
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 📖 读取 Notion 页面内容
env:
NOTION_TOKEN: ${{ secrets.NOTION_API_KEY }}
NOTION_PAGE_URL: ${{ github.event.client_payload.notion_page_url || github.event.inputs.notion_page_url }}
NOTION_OUTPUT_DIR: ${{ (github.event.client_payload.save_to_repo == 'true' || github.event.inputs.save_to_repo == 'true') && 'data/notion-pages' || '' }}
run: node scripts/notion-page-reader.js
- name: 💾 提交保存的页面内容
if: github.event.client_payload.save_to_repo == 'true' || github.event.inputs.save_to_repo == 'true'
run: |
git config user.name "zhuyuan-bot"
git config user.email "zhuyuan-bot@guanghulab.com"
git add data/notion-pages/
if git diff --cached --quiet; then
echo "没有新文件需要提交"
else
git commit -m "📖 铸渊 · 保存 Notion 页面内容 [skip ci]"
git push
fi