Skip to content

自动化扫描错误链接 #34

@hotlong

Description

@hotlong

我正在维护一个基于 Fumadocs (Next.js) 的文档项目。请帮我配置一个 GitHub Action 自动化工作流,使用 "lychee-action" 来检测项目中的死链接。

具体要求如下:

  1. 工作流文件:在 .github/workflows/ 目录下创建一个名为 check-links.yml 的文件。
  2. 触发条件:当代码 push 到 main 分支,或者有 Pull Request 提交时触发。
  3. 扫描范围:扫描 content 目录下的所有 .md.mdx 文件(这是 Fumadocs 存放文档的地方),以及根目录的 README.md
  4. 忽略规则:创建一个 .lycheeignore 文件,默认忽略以下链接(防止误报):
    • 所有的 http://localhost* (本地开发链接)
    • https://example.com (示例链接)
    • https://twitter.com*https://x.com* (防止社交媒体反爬虫报错)
  5. 执行策略:如果发现死链,CI 必须报错(Fail),阻止代码合并。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions