mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-23 17:48:34 +08:00
fix(workflows): fix CodeQL languages detection bug on PR request
This commit is contained in:
@@ -55,7 +55,7 @@ jobs:
|
||||
let has_hit = false;
|
||||
|
||||
try {
|
||||
await github.paginate(pulls.listFiles, {
|
||||
const count = (await github.paginate(pulls.listFiles, {
|
||||
owner,
|
||||
repo,
|
||||
per_page: 100,
|
||||
@@ -69,9 +69,14 @@ jobs:
|
||||
} else {
|
||||
has_hit |= all_exts.includes(ext);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
});
|
||||
return [files.length];
|
||||
})).reduce((a, b) => a + b, 0);
|
||||
|
||||
if (count === 3_000) { // The paginated response include a maximum of 3000 files
|
||||
console.log("::set-output name=language::${{ matrix.language }}"); // Fallback to all language
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
console.log("::set-output name=language::${{ matrix.language }}"); // Fallback to all language
|
||||
|
||||
Reference in New Issue
Block a user