From ec61f9085d822c134dcf0bc2a6336fab992b67ed Mon Sep 17 00:00:00 2001 From: Brian Luby Date: Wed, 29 Apr 2026 20:57:20 -0700 Subject: [PATCH 1/2] fix: defang upstream github references in issues --- README.md | 2 ++ README.zh.md | 2 ++ src/github.ts | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 77cd492..4f237e1 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ Browse all historical digests in a clean, dark-themed interface — no login req Subscribe in any RSS reader (Feedly, Reeder, NewsBlur, etc.) to receive new digests automatically. The feed includes the latest 30 reports across all report types, updated daily alongside `manifest.json`. +GitHub Issues are posted with upstream GitHub issue/PR links defanged to avoid creating mention/backreference noise in tracked project repositories. The committed Markdown reports and Web UI keep the normal source links. + ## MCP Server **`https://big-model-radar-mcp..workers.dev`** diff --git a/README.zh.md b/README.zh.md index 9ece34e..3d39996 100644 --- a/README.zh.md +++ b/README.zh.md @@ -16,6 +16,8 @@ 在任意 RSS 阅读器(Feedly、Reeder、NewsBlur 等)中订阅,每日自动推送新简报。Feed 包含最新 30 条报告(覆盖所有报告类型),与 `manifest.json` 同步更新。 +发布到 GitHub Issues 的正文会对上游 GitHub Issue/PR 链接做 defang 处理,避免在被追踪项目仓库中产生 mention/backreference 噪音。提交到仓库的 Markdown 报告和 Web UI 仍保留正常源链接。 + ## MCP Server **`https://big-model-radar-mcp..workers.dev`** diff --git a/src/github.ts b/src/github.ts index 35c4bde..09e9bde 100644 --- a/src/github.ts +++ b/src/github.ts @@ -184,8 +184,20 @@ export async function fetchSkillsData(repo: string): Promise<{ prs: GitHubItem[] const GITHUB_ISSUE_BODY_LIMIT = 65536; const TRUNCATION_NOTICE = "\n\n---\n> ⚠️ 内容超过 GitHub Issue 上限,完整报告见提交的 Markdown 文件。"; +function defangGitHubNotifications(body: string): string { + return body + .replace( + /https?:\/\/(?:www\.)?github\.com\/([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)\/(issues|pull)\/(\d+)/g, + (_match, owner: string, repo: string, type: string, number: string) => + `github[.]com/${owner}/${repo}/${type}/${number}`, + ) + .replace(/\b([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)#(\d+)\b/g, "`$1#$2`") + .replace(/(^|[^\w`])@([A-Za-z0-9-]{1,39})\b/g, "$1@\u200B$2"); +} + export async function createGitHubIssue(title: string, body: string, label: string): Promise { const digestRepo = process.env["DIGEST_REPO"] ?? ""; + body = defangGitHubNotifications(body); if (body.length > GITHUB_ISSUE_BODY_LIMIT) { body = body.slice(0, GITHUB_ISSUE_BODY_LIMIT - TRUNCATION_NOTICE.length) + TRUNCATION_NOTICE; } From 7d68bf93d6833ee3f756b93a9446013be1590de0 Mon Sep 17 00:00:00 2001 From: Brian Luby <3779002+brianluby@users.noreply.github.com> Date: Thu, 30 Apr 2026 16:59:11 -0700 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/github.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/github.ts b/src/github.ts index 09e9bde..7176fbe 100644 --- a/src/github.ts +++ b/src/github.ts @@ -187,9 +187,20 @@ const TRUNCATION_NOTICE = "\n\n---\n> ⚠️ 内容超过 GitHub Issue 上限, function defangGitHubNotifications(body: string): string { return body .replace( - /https?:\/\/(?:www\.)?github\.com\/([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)\/(issues|pull)\/(\d+)/g, - (_match, owner: string, repo: string, type: string, number: string) => - `github[.]com/${owner}/${repo}/${type}/${number}`, + /https?:\/\/(?:www\.)?github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/(?:issues|pull)\/\d+(?:[/?#][^\s`<>"']*)?/g, + (match: string) => { + const trailingPunctuationMatch = match.match(/[),.!?:;]+$/); + const trailingPunctuation = trailingPunctuationMatch?.[0] ?? ""; + const urlWithoutTrailingPunctuation = trailingPunctuation + ? match.slice(0, -trailingPunctuation.length) + : match; + return ( + urlWithoutTrailingPunctuation.replace( + /^https?:\/\/(?:www\.)?github\.com/, + "github[.]com", + ) + trailingPunctuation + ); + }, ) .replace(/\b([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)#(\d+)\b/g, "`$1#$2`") .replace(/(^|[^\w`])@([A-Za-z0-9-]{1,39})\b/g, "$1@\u200B$2");