Skip to content

fix: 评论审核 fail-closed + 跳过无 CF 密钥的 docs 部署 - #5

Merged
gaoran1209 merged 1 commit into
mainfrom
fix/notion-comments-approval-and-docs-deploy
Sep 15, 2026
Merged

gaoran1209 merged 1 commit into
mainfrom
fix/notion-comments-approval-and-docs-deploy

Conversation

@gaoran1209

Copy link
Copy Markdown
Owner

Summary

  • P1 review: pages/api/notion-comments.jsNOTION_COMMENT_REQUIRE_APPROVAL=true 但数据库没有可写的 Status(select/status)时,改为 503 fail-closed,不再静默跳过 Pending 却告诉客户端「待审核」,避免评论被当成公开。
  • 同时支持 Notion status 类型字段写入 Pending/Approved。
  • Deploy docs site (VitePress) 失败原因:fork 未配置 CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID。个人博客不需要部署上游文档站,改为缺密钥时跳过并成功结束。

Test plan

  • 开启审核且 Status 为 select/status 时,新评论写入 Pending,GET 不展示
  • 开启审核但无 Status 字段时,POST 返回 503,不落库
  • main 推送触发 docs workflow:无 CF secrets 时显示 skip,不报红

…out CF secrets

When NOTION_COMMENT_REQUIRE_APPROVAL is enabled, refuse to create comments
unless Status is a writable select/status property, and support both types.
Also skip the upstream VitePress docs Cloudflare deploy when this fork has
no CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID configured.
@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ryanblog Ready Ready Preview Sep 15, 2026 2:28am UTC

@github-actions github-actions Bot added the core label Sep 15, 2026
@gaoran1209
gaoran1209 merged commit 3412b30 into main Sep 15, 2026
8 checks passed
@gaoran1209
gaoran1209 deleted the fix/notion-comments-approval-and-docs-deploy branch September 15, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant