From d0507d9a8aa31040a20f22b35e8317d8b8501070 Mon Sep 17 00:00:00 2001 From: Michal Dorner Date: Sun, 11 Apr 2021 21:39:09 +0200 Subject: [PATCH] Improve log output --- dist/index.js | 5 +++-- src/main.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9914fa9..914be19 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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 { diff --git a/src/main.ts b/src/main.ts index 5f6d4b3..466d695 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,6 +33,7 @@ async function run(): Promise { 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()