zhizhi/.github/workflows/push-broadcast.yml

48 lines
1.3 KiB
YAML
Raw 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.

name: 铸渊 · Push Broadcast · Notion → 飞书文档B
# 链路2新广播推送
# Notion 新广播页面 → 追加到飞书文档B顶部
#
# 依赖 Secrets
# NOTION_TOKEN Notion API token
# FEISHU_APP_ID 飞书应用 App ID
# FEISHU_APP_SECRET 飞书应用 App Secret
# FEISHU_DOC_B_ID 飞书文档B的 document_id
#
# dispatch payload
# broadcast_page_id Notion 广播页面 ID
on:
repository_dispatch:
types: [push-broadcast]
workflow_dispatch:
inputs:
broadcast_page_id:
description: 'Notion 广播页面 ID'
required: true
jobs:
push-broadcast:
name: 📡 推送广播到飞书
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 📡 推送广播 → 飞书文档B
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
BROADCAST_PAGE_ID: ${{ github.event.client_payload.broadcast_page_id || github.event.inputs.broadcast_page_id }}
FEISHU_APP_ID: ${{ secrets.FEISHU_APP_ID }}
FEISHU_APP_SECRET: ${{ secrets.FEISHU_APP_SECRET }}
FEISHU_DOC_B_ID: ${{ secrets.FEISHU_DOC_B_ID }}
run: node scripts/push-broadcast.js