From 8d59284fa72234c842a256fcee3a3edb7c68b493 Mon Sep 17 00:00:00 2001 From: Rob van der Leek <5324924+robvanderleek@users.noreply.github.com> Date: Thu, 29 Feb 2024 17:46:21 +0100 Subject: [PATCH] Do no run when no files changed --- src/action.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/action.js b/src/action.js index cd68d9a..0d83437 100644 --- a/src/action.js +++ b/src/action.js @@ -92,8 +92,12 @@ async function getChangedFiles(token) { if (doCheck && exitCode === 0) { const changedFiles = await getChangedFiles(token); console.log(`Number of files changed: ${changedFiles.length}`); - console.log('Running Code Limit...'); - exitCode = await exec(filename, ['check'].concat(changedFiles), {ignoreReturnCode: true}); + if (changedFiles.length === 0) { + console.log('No files changed, skipping Code Limit'); + } else { + console.log('Running Code Limit...'); + exitCode = await exec(filename, ['check'].concat(changedFiles), {ignoreReturnCode: true}); + } } fs.unlinkSync(filename); console.log('Done!');