Skip to content

Commit c6f2ac5

Browse files
Copilotkenyonj
andauthored
Sanitize item in invalid format branch to prevent Markdown injection
Agent-Logs-Url: https://github.com/github/explore/sessions/f0f46334-8894-40b6-bcc2-87dba102c83d Co-authored-by: kenyonj <4008677+kenyonj@users.noreply.github.com>
1 parent eb1b6c7 commit c6f2ac5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/explore-triage-commenter.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ jobs:
131131
132132
for (const item of items) {
133133
if (!/^[\w.-]+\/[\w.-]+$/.test(item)) {
134-
lines.push(`| \`${item}\` | – | – | – | invalid format |`);
134+
const safeItem = item.replace(/`/g, "'").replace(/\\/g, '\\\\').replace(/\|/g, '\\|');
135+
lines.push(`| \`${safeItem}\` | – | – | – | invalid format |`);
135136
continue;
136137
}
137138
const [owner, repo] = item.split('/');

0 commit comments

Comments
 (0)