mirror of
https://github.com/github/awesome-copilot.git
synced 2026-06-14 20:05:15 +00:00
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -36,9 +36,19 @@ jobs:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const body = fs.readFileSync(reportPath, 'utf8');
|
let body = fs.readFileSync(reportPath, 'utf8');
|
||||||
let prNumber = null;
|
|
||||||
|
|
||||||
|
// Treat artifact content as untrusted (the gate workflow runs on PR code).
|
||||||
|
// Prevent spam/notification abuse and avoid API failures on oversized bodies.
|
||||||
|
body = body.replace(/@/g, '@\u200b');
|
||||||
|
const maxLength = 65000;
|
||||||
|
if (body.length > maxLength) {
|
||||||
|
body = `${body.slice(0, maxLength)}\n\n_...(truncated)..._`;
|
||||||
|
}
|
||||||
|
if (!body.includes(marker)) {
|
||||||
|
body = `${marker}\n${body}`;
|
||||||
|
}
|
||||||
|
let prNumber = null;
|
||||||
if (fs.existsSync(prNumberPath)) {
|
if (fs.existsSync(prNumberPath)) {
|
||||||
const parsed = parseInt(fs.readFileSync(prNumberPath, 'utf8').trim(), 10);
|
const parsed = parseInt(fs.readFileSync(prNumberPath, 'utf8').trim(), 10);
|
||||||
if (!Number.isNaN(parsed)) {
|
if (!Number.isNaN(parsed)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user