Skip to content

Crawl CloudBase API Docs #46

Crawl CloudBase API Docs

Crawl CloudBase API Docs #46

Workflow file for this run

name: Crawl CloudBase API Docs
on:
schedule:
- cron: "0 2 * * *" # 每天 UTC 02:00 (北京时间 10:00)
workflow_dispatch: # 手动触发
permissions:
contents: write # 允许推送代码
jobs:
crawl:
runs-on: ubuntu-latest
steps:
- name: Checkout target branch
uses: actions/checkout@v4
with:
ref: chore/pure_doc_skill
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: npm ci
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Crawl docs
run: npx tsx scripts/crawl-tcb-docs.ts
- name: Generate action list
run: npx tsx scripts/generate-actionlist.ts
- name: Commit and push
run: |
git add -A
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: 🔄 update API docs and action-list"
git push
fi