|
1 | 1 | class StaticAnalysis { |
2 | | - constructor(dataProvider, process, ignoredAccounts = []) { |
| 2 | + constructor(dataProvider, process, ignoredAccounts = [], domains = null) { |
3 | 3 | this.dataProvider = dataProvider; |
4 | 4 | this.process = process; |
5 | 5 | this.ignoredAccounts = ignoredAccounts; |
| 6 | + this.domains = domains; |
6 | 7 | } |
7 | 8 |
|
8 | 9 | isCommitHash(ref) { |
@@ -58,8 +59,11 @@ class StaticAnalysis { |
58 | 59 |
|
59 | 60 | // Scan domains/*/.github/**/*.yml files if domains directory exists |
60 | 61 | if (this.dataProvider.fileExists(domainsDir)) { |
61 | | - const domains = this.dataProvider.readDirectory(domainsDir); |
62 | | - domains.forEach(domain => { |
| 62 | + const domainsToScan = this.domains ? |
| 63 | + this.domains.include.filter(domain => domain.project !== '.').map(domain => domain.project) : |
| 64 | + this.dataProvider.readDirectory(domainsDir); |
| 65 | + |
| 66 | + domainsToScan.forEach(domain => { |
63 | 67 | const domainPath = this.dataProvider.path.join(domainsDir, domain); |
64 | 68 | const domainGithubPath = this.dataProvider.path.join(domainPath, '.github'); |
65 | 69 |
|
@@ -120,7 +124,8 @@ const fs = require('fs'); |
120 | 124 | const path = require('path'); |
121 | 125 | const process = require('process'); |
122 | 126 | const ignoredAccounts = (process.env.IGNORED_ACCOUNTS || '').split(','); |
| 127 | +const domains = process.env.DOMAINS ? JSON.parse(process.env.DOMAINS) : null; |
123 | 128 |
|
124 | 129 | const dataProvider = new DataProvider(fs, path); |
125 | | -const staticAnalysis = new StaticAnalysis(dataProvider, process, ignoredAccounts); |
| 130 | +const staticAnalysis = new StaticAnalysis(dataProvider, process, ignoredAccounts, domains); |
126 | 131 | staticAnalysis.run(); |
0 commit comments