Skip to content

Commit 123a10f

Browse files
intSheepactions-user
authored andcommitted
feat: add GitHub Actions workflow for publishing Feishu articles
- Add workflow_dispatch triggered CI workflow - Add script to fetch Feishu docx content, download images, generate frontmatter, and create a PR - Title/author/tags are optional, falling back to Feishu doc metadata
1 parent 25d7a15 commit 123a10f

2 files changed

Lines changed: 494 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish Feishu Article
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
feishu_url:
7+
description: '飞书文档链接(新版 Docx)'
8+
required: true
9+
type: string
10+
title:
11+
description: '文章标题(留空从文档提取)'
12+
required: false
13+
type: string
14+
author:
15+
description: '作者(留空为空)'
16+
required: false
17+
type: string
18+
tags:
19+
description: '标签,逗号分隔(留空则无)'
20+
required: false
21+
type: string
22+
23+
permissions:
24+
contents: write
25+
pull-requests: write
26+
27+
jobs:
28+
publish:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
token: ${{ secrets.GH_TOKEN }}
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: '20'
41+
42+
- name: Import Feishu Article
43+
env:
44+
FEISHU_APP_ID: ${{ secrets.FEISHU_APP_ID }}
45+
FEISHU_APP_SECRET: ${{ secrets.FEISHU_APP_SECRET }}
46+
INPUT_URL: ${{ github.event.inputs.feishu_url }}
47+
INPUT_TITLE: ${{ github.event.inputs.title }}
48+
INPUT_AUTHOR: ${{ github.event.inputs.author }}
49+
INPUT_TAGS: ${{ github.event.inputs.tags }}
50+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
51+
GITHUB_REPOSITORY: ${{ github.repository }}
52+
run: node scripts/import-feishu-article.js

0 commit comments

Comments
 (0)