(data: UserData)
| 356 | } |
| 357 | |
| 358 | function parseUserData(data: UserData): string { |
| 359 | const { |
| 360 | username, |
| 361 | name, |
| 362 | bio, |
| 363 | location, |
| 364 | status, |
| 365 | pullRequests, |
| 366 | repositoriesContributedTo, |
| 367 | profileContent, |
| 368 | } = data; |
| 369 | |
| 370 | return `用户名: ${username} |
| 371 | 昵称: ${name} |
| 372 | 简介: ${bio} |
| 373 | 位置: ${location} |
| 374 | 状态: ${status?.emoji || "无状态"} ${status?.message || "无状态信息"} |
| 375 | PR 记录: |
| 376 | <START_PULL_REQUESTS> |
| 377 | ${ |
| 378 | pullRequests |
| 379 | ?.map( |
| 380 | (pr) => |
| 381 | `- ${pr.title} (${pr.repository.nameWithOwner})\n ${pr.body}\n 创建于: ${pr.createdAt}` |
| 382 | ) |
| 383 | .join("\n") || "无 PR 记录" |
| 384 | } |
| 385 | <END_PULL_REQUESTS> |
| 386 | Commit 记录: |
| 387 | <START_COMMITS> |
| 388 | ${ |
| 389 | repositoriesContributedTo |
| 390 | ?.map( |
| 391 | (repo) => |
| 392 | `- ${repo.nameWithOwner} (${repo.description})\n 提交记录:\n ${ |
| 393 | repo?.commits |
| 394 | ?.map((commit) => `- ${commit.message} (${commit.committedDate})`) |
| 395 | .join("\n") || "无 Commit 记录" |
| 396 | }` |
| 397 | ) |
| 398 | .join("\n") || "无 Commit 记录" |
| 399 | } |
| 400 | <END_COMMITS> |
| 401 | 个人资料内容: |
| 402 | <START_PROFILE_CONTENT> |
| 403 | ${profileContent || "无个人资料页"} |
| 404 | <END_PROFILE_CONTENT>`; |
| 405 | } |
| 406 | |
| 407 | // Function to generate a hash key from commit data and preset |
| 408 | function generateReportKey(login: string, presetKey: string): string { |
no outgoing calls
no test coverage detected