mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
Rely on limit
This commit is contained in:
@@ -30,9 +30,6 @@ async function getPRDetails(github, core, owner, repo, pull_number) {
|
||||
let packagesAffected = new Set();
|
||||
for (let file of files) {
|
||||
if (file.filename.startsWith('lib/core/')) {
|
||||
if (file.filename.startsWith('lib/core/auth/')) {
|
||||
level = 'extreme';
|
||||
}
|
||||
level = 'major';
|
||||
packageName = 'core';
|
||||
packagesAffected.add(packageName);
|
||||
@@ -50,18 +47,10 @@ async function getPRDetails(github, core, owner, repo, pull_number) {
|
||||
}
|
||||
|
||||
if (level !== 'major') {
|
||||
if (linesChanged > 100) {
|
||||
if (filesChanged > LIMIT_FILE_CHANGED) {
|
||||
level = 'major';
|
||||
} else if (linesChanged > 50) {
|
||||
level = 'medium';
|
||||
}
|
||||
}
|
||||
|
||||
if (level !== 'major') {
|
||||
if (filesChanged > 10) {
|
||||
} else if (linesChanged > LIMIT_LINES_CHANGED) {
|
||||
level = 'major';
|
||||
} else if (filesChanged > 5) {
|
||||
level = 'medium';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +67,9 @@ module.exports = async ({ core, github, context, fileChangedLimit = 5, linesChan
|
||||
const repo = context.repo.repo;
|
||||
const pull_number = context.payload.pull_request.number;
|
||||
|
||||
const LIMIT_FILE_CHANGED = fileChangedLimit;
|
||||
const LIMIT_LINES_CHANGED = linesChangedLimit;
|
||||
|
||||
core.info(`Getting PR details for ${owner}/${repo}#${pull_number}`);
|
||||
core.info(`Limit for files changed: ${fileChangedLimit}`);
|
||||
core.info(`Limit for lines changed: ${linesChangedLimit}`);
|
||||
|
||||
Reference in New Issue
Block a user