Skip to content

Commit

Permalink
Check only tracked files (#32960)
Browse files Browse the repository at this point in the history
Otherwise could check files generated by a task running on CI.
  • Loading branch information
alanorozco committed Mar 1, 2021
1 parent 652ae93 commit cde4736
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions build-system/common/utils.js
Expand Up @@ -21,7 +21,7 @@ const path = require('path');
const {clean} = require('../tasks/clean');
const {doBuild} = require('../tasks/build');
const {doDist} = require('../tasks/dist');
const {execOrDie} = require('./exec');
const {execOrDie, getStdout} = require('./exec');
const {gitDiffNameOnlyMaster} = require('./git');
const {green, cyan, yellow} = require('kleur/colors');
const {log, logLocalDev} = require('./logging');
Expand Down Expand Up @@ -111,7 +111,14 @@ function getFilesToCheck(globs, options = {}) {
}
return logFiles(filesChanged);
}
return globby.sync(globs, options);
const untrackedFiles = getStdout('git ls-files --others --exclude-standard')
.trim()
.split('\n');
return globby.sync(globs, {
ignore: untrackedFiles,
gitignore: true,
...options,
});
}

/**
Expand Down

0 comments on commit cde4736

Please sign in to comment.