Skip to content

Fix lychee exclude-path regex patterns in link checker workflow#362

Merged
hotlong merged 4 commits intomainfrom
copilot/add-error-handling-to-api
Jan 28, 2026
Merged

Fix lychee exclude-path regex patterns in link checker workflow#362
hotlong merged 4 commits intomainfrom
copilot/add-error-handling-to-api

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 28, 2026

The link checker workflow fails with "regex parse error: repetition operator missing expression" because --exclude-path arguments use glob patterns (**/meta.json) instead of valid regex.

Changes

  • Convert glob patterns to regex in .github/workflows/check-links.yml:
    • **/meta.json(^|.*/)meta\.json$
    • **/meta.cn.json(^|.*/)meta\.cn\.json$

The pattern (^|.*/)meta\.json$ matches files exactly named meta.json at any path depth while rejecting custom-meta.json or similar variants.

args: >-
  --config lychee.toml
  --exclude-path '(^|.*/)meta\.json$'
  --exclude-path '(^|.*/)meta\.cn\.json$'
  'content/**/*.md'
  'content/**/*.mdx'
  'README.md'
Original prompt

引用: https://github.com/objectstack-ai/spec/actions/runs/21436374758/job/61727998793#step:3:1


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 28, 2026

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

Project Deployment Review Updated (UTC)
spec Canceled Canceled Jan 28, 2026 11:34am

Request Review

Copilot AI and others added 3 commits January 28, 2026 11:29
Convert glob patterns to valid regex patterns:
- Change '**/meta.json' to '.*/meta\.json$'
- Change '**/meta.cn.json' to '.*/meta\.cn\.json$'

This fixes the GitHub Actions "Check Links" workflow failure caused by
invalid regex syntax. The ** glob pattern was being interpreted as a
regex repetition operator without an expression.

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Use '.*meta\.json$' instead of '.*/meta\.json$' to match files
both with and without directory paths. This ensures all meta.json
and meta.cn.json files are properly excluded from link checking.

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Use '(^|.*/)meta\.json$' instead of '.*meta\.json$' to match only
files exactly named 'meta.json', not files ending with 'meta.json'
like 'custom-meta.json'. This follows the original intent of the
glob pattern '**/meta.json'.

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Add error handling to API endpoints Fix lychee exclude-path regex patterns in link checker workflow Jan 28, 2026
Copilot AI requested a review from hotlong January 28, 2026 11:34
@hotlong hotlong marked this pull request as ready for review January 28, 2026 11:43
Copilot AI review requested due to automatic review settings January 28, 2026 11:43
@hotlong hotlong merged commit 2f8aa3c into main Jan 28, 2026
5 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a regex parse error in the GitHub Actions link checker workflow by converting glob patterns to proper regex syntax for the --exclude-path argument in lychee.

Changes:

  • Updated --exclude-path arguments in the link checker workflow from glob patterns (**/meta.json) to valid regex patterns ((^|.*/)meta\.json$)
  • Applied the same fix for both meta.json and meta.cn.json exclusion patterns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants