optimise github actions
This commit is contained in:
@@ -8,6 +8,9 @@ const IS_AZURE_PIPELINES = process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI !== un
|
||||
const IS_GITHUB_ACTIONS = process.env.GITHUB_ACTIONS === 'true';
|
||||
const FILE_PATH_COLOR = '\x1b[36m%s\x1b[0m';
|
||||
|
||||
if (IS_CI) {
|
||||
console.log('::group::Checking path length');
|
||||
}
|
||||
console.log(`Checking path length in ${PROJECT_DIR} for paths exceeding ${MAX_PATH_LENGTH}...`);
|
||||
console.log('CI detected:', IS_CI);
|
||||
|
||||
@@ -27,9 +30,9 @@ function checkPathLength(dir) {
|
||||
}
|
||||
|
||||
if (IS_AZURE_PIPELINES) {
|
||||
console.error(`##vso[task.logissue type=warn;]Path exceeds maximum length of ${MAX_PATH_LENGTH} characters: ${filePath} with ${filePath.length} characters`);
|
||||
console.error(`##vso[task.logissue type=warning;]Path exceeds maximum length of ${MAX_PATH_LENGTH} characters: ${filePath} with ${filePath.length} characters`);
|
||||
} else if (IS_GITHUB_ACTIONS) {
|
||||
console.error(`::warn file=${filePath}::Path exceeds maximum length of ${MAX_PATH_LENGTH} characters with ${filePath.length} characters`);
|
||||
console.error(`::warning file=${filePath},title=Path exceeds ${MAX_PATH_LENGTH}::Paths should not be longer than ${MAX_PATH_LENGTH} characters to support WIN32 systems. This file exceeds that with ${MAX_PATH_LENGTH - filePath.length} characters.`);
|
||||
} else {
|
||||
console.error(`Path exceeds maximum length of ${MAX_PATH_LENGTH} characters: ${FILE_PATH_COLOR}`, filePath, filePath.length);
|
||||
}
|
||||
@@ -42,3 +45,7 @@ function checkPathLength(dir) {
|
||||
}
|
||||
|
||||
checkPathLength(PROJECT_DIR, MAX_PATH_LENGTH);
|
||||
|
||||
if (IS_CI) {
|
||||
console.log('::endgroup::');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user