Improve log output

This commit is contained in:
Michal Dorner 2021-04-11 21:39:09 +02:00
parent f093f3520b
commit d0507d9a8a
No known key found for this signature in database
GPG Key ID: 9EEE04B48DA36786
2 changed files with 6 additions and 4 deletions

5
dist/index.js vendored
View File

@ -4712,6 +4712,7 @@ async function run() {
}
const filter = new filter_1.Filter(filtersYaml);
const files = await getChangedFiles(token, base, ref, initialFetchDepth);
core.info(`Detected ${files.length} changed files`);
const results = filter.match(files);
exportResults(results, listFiles);
}
@ -4808,10 +4809,11 @@ async function getChangedFilesFromApi(token, pullRequest) {
if (response.status !== 200) {
throw new Error(`Fetching list of changed files from GitHub API failed with error code ${response.status}`);
}
core.info(`Received ${response.data.length} items`);
if (response.data.length === 0) {
core.info('All changed files has been fetched from GitHub API');
break;
}
core.info(`Received ${response.data.length} items`);
for (const row of response.data) {
core.info(`[${row.status}] ${row.filename}`);
// There's no obvious use-case for detection of renames
@ -4838,7 +4840,6 @@ async function getChangedFilesFromApi(token, pullRequest) {
}
}
}
core.info(`Found ${files.length} changed files`);
return files;
}
finally {

View File

@ -33,6 +33,7 @@ async function run(): Promise<void> {
const filter = new Filter(filtersYaml)
const files = await getChangedFiles(token, base, ref, initialFetchDepth)
core.info(`Detected ${files.length} changed files`)
const results = filter.match(files)
exportResults(results, listFiles)
} catch (error) {
@ -151,11 +152,12 @@ async function getChangedFilesFromApi(
throw new Error(`Fetching list of changed files from GitHub API failed with error code ${response.status}`)
}
core.info(`Received ${response.data.length} items`)
if (response.data.length === 0) {
core.info('All changed files has been fetched from GitHub API')
break
}
core.info(`Received ${response.data.length} items`)
for (const row of response.data) {
core.info(`[${row.status}] ${row.filename}`)
// There's no obvious use-case for detection of renames
@ -182,7 +184,6 @@ async function getChangedFilesFromApi(
}
}
core.info(`Found ${files.length} changed files`)
return files
} finally {
core.endGroup()