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:
+12
-1
@@ -340,11 +340,22 @@ function main() {
|
||||
|
||||
scanSkillScriptPath(relativePath, findings);
|
||||
|
||||
if (!fs.existsSync(absolutePath) || !fs.statSync(absolutePath).isFile()) {
|
||||
if (!fs.existsSync(absolutePath)) {
|
||||
skippedFiles.push(relativePath);
|
||||
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);
|
||||
if (!isPotentialText(contentBuffer)) {
|
||||
skippedFiles.push(relativePath);
|
||||
|
||||
Reference in New Issue
Block a user