Commit fcbe3a5
committed
fix(github): reject a malformed three-segment repoFullName in comments.ts
`createOrUpdateIssueCommentWithMarker` validated `repoFullName` with
`const [owner, repo] = repoFullName.split("/")` + a truthiness check, so
"owner/repo/extra" passed: the destructure silently dropped the extra segment
and the GitHub call was issued against "owner/repo" — a repo the caller never
specified.
Add the missing `parts.length !== 2` segment-count check inline, matching the
guard already present in parseRepoFullName (assignees.ts / labels.ts). No-slash
and empty-segment inputs are still rejected exactly as before; whitespace
handling is intentionally left unchanged (a separate issue covers that in a
different file).
Extends test/unit/github-comments.test.ts with a case asserting
"owner/repo/extra" is rejected via createOrUpdatePrIntelligenceComment,
mirroring the existing precedent in github-assignees.test.ts.
Closes #66121 parent 42805e0 commit fcbe3a5
2 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
382 | 390 | | |
383 | 391 | | |
384 | 392 | | |
| |||
0 commit comments