Skip to content

Commit 6e073a1

Browse files
Merge pull request #88 from VirdocsSoftware/release/v2.14.0
release v2.14.0 to main
2 parents b3b7a55 + ed22cbf commit 6e073a1

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

.github/actions/static-analysis/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ inputs:
1212
required: true
1313

1414
domains:
15-
description: "Comma-separated list of domains to analyze"
15+
description: "JSON string containing domains to analyze (e.g. {\"include\": [{\"project\": \"domain1\"}, {\"project\": \"domain2\"}]})"
1616
required: true
1717

1818
runs:
@@ -32,6 +32,7 @@ runs:
3232
working-directory: ${{ github.workspace }}
3333
env:
3434
IGNORED_ACCOUNTS: ${{ inputs.ignored-accounts }}
35+
DOMAINS: ${{ inputs.domains }}
3536
continue-on-error: true
3637

3738
- name: Run layer dependency analysis

.github/actions/static-analysis/scan_github_actions.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
class StaticAnalysis {
2-
constructor(dataProvider, process, ignoredAccounts = []) {
2+
constructor(dataProvider, process, ignoredAccounts = [], domains = null) {
33
this.dataProvider = dataProvider;
44
this.process = process;
55
this.ignoredAccounts = ignoredAccounts;
6+
this.domains = domains;
67
}
78

89
isCommitHash(ref) {
@@ -58,8 +59,11 @@ class StaticAnalysis {
5859

5960
// Scan domains/*/.github/**/*.yml files if domains directory exists
6061
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 => {
6367
const domainPath = this.dataProvider.path.join(domainsDir, domain);
6468
const domainGithubPath = this.dataProvider.path.join(domainPath, '.github');
6569

@@ -120,7 +124,8 @@ const fs = require('fs');
120124
const path = require('path');
121125
const process = require('process');
122126
const ignoredAccounts = (process.env.IGNORED_ACCOUNTS || '').split(',');
127+
const domains = process.env.DOMAINS ? JSON.parse(process.env.DOMAINS) : null;
123128

124129
const dataProvider = new DataProvider(fs, path);
125-
const staticAnalysis = new StaticAnalysis(dataProvider, process, ignoredAccounts);
130+
const staticAnalysis = new StaticAnalysis(dataProvider, process, ignoredAccounts, domains);
126131
staticAnalysis.run();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-actions",
3-
"version": "2.13.1",
3+
"version": "2.14.0",
44
"description": "Used to store GitHub actions for use across the enterprise",
55
"scripts": {
66
"test": "./tooling/scripts/run_tests.sh",

0 commit comments

Comments
 (0)