Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<your-subdomain>.workers.dev`**
Expand Down
2 changes: 2 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<your-subdomain>.workers.dev`**
Expand Down
23 changes: 23 additions & 0 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,31 @@ 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+(?:[/?#][^\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");
Comment on lines +187 to +206

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@copilot update you suggestion or close this issue if no longer valid.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

}

export async function createGitHubIssue(title: string, body: string, label: string): Promise<string> {
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;
}
Expand Down