Skip to content

Commit

Permalink
Do no run when no files changed
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanderleek committed Feb 29, 2024
1 parent 572d6a3 commit 8d59284
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
Expand Down

0 comments on commit 8d59284

Please sign in to comment.