55 lines
1.7 KiB
Markdown
55 lines
1.7 KiB
Markdown
# GitHub Star 每日刷新
|
|
|
|
- Registry ID: `github-star-refresh`
|
|
- n8n Workflow ID: `ewx9Gs6cjrTXvwD0`
|
|
- Status: `confirmed`
|
|
- 角色: 每日刷新项目的 GitHub Star 数,保证排序、排行和展示的时效性。
|
|
|
|
## 触发方式
|
|
|
|
- 定时触发
|
|
- 当前已核查行为:每日约 `04:00` 运行
|
|
|
|
## 数据来源
|
|
|
|
- `projects`
|
|
- `external_links`
|
|
- GitHub Repository API
|
|
|
|
## 主流程
|
|
|
|
1. 从数据库读取活跃项目及其 GitHub 外链。
|
|
2. 解析 GitHub 仓库 owner/repo。
|
|
3. 调用 GitHub Repository API 获取最新 star 数。
|
|
4. 直接写回 `projects.githubStars` 与 `projects.githubStarsUpdatedAt`。
|
|
|
|
## 直接写入字段
|
|
|
|
- `projects.githubStars`
|
|
- `projects.githubStarsUpdatedAt`
|
|
|
|
## 与仓库的关系
|
|
|
|
这条流程不是调用仓库 API,而是直接维护数据库中的展示字段。当前仓库内受其影响的消费面包括:
|
|
|
|
- [schema.prisma](D:/Code/AI/agent-park/prisma/schema.prisma)
|
|
- [route.ts](D:/Code/AI/agent-park/src/app/api/search/ai/route.ts)
|
|
- [useProjects.ts](D:/Code/AI/agent-park/src/hooks/useProjects.ts)
|
|
|
|
## 下游影响
|
|
|
|
- 首页排行
|
|
- 项目列表按 star 排序
|
|
- AI 搜索结果中的 `stars_desc` / `stars_asc`
|
|
|
|
## 已确认要点
|
|
|
|
- 已通过 live n8n MCP 核查 workflow 元数据与职责。
|
|
- 该流程直接读写 Postgres,而不是走 Next.js API。
|
|
- 所以如果星标不更新,优先排查 n8n 与数据库连接,而不是先看前端排序代码。
|
|
|
|
## 维护要求
|
|
|
|
- 如果 `external_links` 的 GitHub 链接筛选规则改变,要同步更新这里和 [registry.json](D:/Code/AI/agent-park/docs/integrations/n8n/registry.json)。
|
|
- 如果后续改成走仓库 API 写入,应把“直接 DB 写”改成“仓库 API 触点”。
|