mirror of
https://github.com/github/awesome-copilot.git
synced 2026-06-22 07:27:39 +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:
+12
-1
@@ -340,11 +340,22 @@ function main() {
|
|||||||
|
|
||||||
scanSkillScriptPath(relativePath, findings);
|
scanSkillScriptPath(relativePath, findings);
|
||||||
|
|
||||||
if (!fs.existsSync(absolutePath) || !fs.statSync(absolutePath).isFile()) {
|
if (!fs.existsSync(absolutePath)) {
|
||||||
skippedFiles.push(relativePath);
|
skippedFiles.push(relativePath);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const stat = fs.statSync(absolutePath);
|
||||||
|
if (!stat.isFile()) {
|
||||||
|
skippedFiles.push(relativePath);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stat.size > 1024 * 1024) {
|
||||||
|
skippedFiles.push(`${relativePath} (skipped: file too large)`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const contentBuffer = fs.readFileSync(absolutePath);
|
const contentBuffer = fs.readFileSync(absolutePath);
|
||||||
if (!isPotentialText(contentBuffer)) {
|
if (!isPotentialText(contentBuffer)) {
|
||||||
skippedFiles.push(relativePath);
|
skippedFiles.push(relativePath);
|
||||||
|
|||||||
Reference in New Issue
Block a user