[CI] Keep original labels when PR has too many lines (#9745)

This commit is contained in:
Jesse Hills 2025-07-21 12:10:47 +12:00 committed by GitHub
parent bb9011d65d
commit 06bd1472de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -414,7 +414,14 @@ jobs:
if ((tooManyLabels || tooManyChanges) && !allowedTooBig) {
const originalLength = finalLabels.length;
console.log(`PR is too big - Labels: ${originalLength}, Changes: ${totalChanges}`);
finalLabels = ['too-big'];
// If too big due to line changes only, keep original labels and add too-big
// If too big due to too many labels, replace with just too-big
if (tooManyChanges && !tooManyLabels) {
finalLabels.push('too-big');
} else {
finalLabels = ['too-big'];
}
// Create appropriate review message
let reviewBody;