@xliic/cicd-core-node
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -39,8 +39,4 @@ "use strict"; | ||
let failureConditions = Object.assign({}, DEFAULT_FAILURE_CONDITIONS); | ||
let audit = {}; | ||
const confFilePath = path.join(rootDir, CONF_FILE); | ||
if (fs.existsSync(confFilePath)) { | ||
audit = readBranchConfig(branchName, parse_1.parseYaml(rootDir, CONF_FILE), confFilePath); | ||
} | ||
else { | ||
if (!fs.existsSync(confFilePath)) { | ||
if (mandatoryConfig) { | ||
@@ -50,6 +46,12 @@ throw new ConfigError(`Config file ${CONF_FILE} is not found`); | ||
else { | ||
// don't check for unmapped files if config file does not exists | ||
failureConditions.unmapped_files = false; | ||
// settings to use if allowed to run with no config | ||
return { | ||
auditDiscovered: true, | ||
discoveryPatterns: DEFAULT_PATTERNS, | ||
mappedFiles: null, | ||
failureConditions: Object.assign(Object.assign({}, DEFAULT_FAILURE_CONDITIONS), { unmapped_files: false }), | ||
}; | ||
} | ||
} | ||
const audit = readBranchConfig(branchName, parse_1.parseYaml(rootDir, CONF_FILE), confFilePath); | ||
if (typeof audit.discovery === "boolean") { | ||
@@ -56,0 +58,0 @@ if (audit.discovery) { |
{ | ||
"name": "@xliic/cicd-core-node", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "Performs API contract security audit to get a detailed analysis of the possible vulnerabilities and other issues in the API contract.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -50,21 +50,28 @@ /* | ||
let failureConditions: FailureConditions = { ...DEFAULT_FAILURE_CONDITIONS }; | ||
let audit: AuditConfig = {}; | ||
const confFilePath = path.join(rootDir, CONF_FILE); | ||
if (fs.existsSync(confFilePath)) { | ||
audit = readBranchConfig( | ||
branchName, | ||
parseYaml(rootDir, CONF_FILE), | ||
confFilePath | ||
); | ||
} else { | ||
if (!fs.existsSync(confFilePath)) { | ||
if (mandatoryConfig) { | ||
throw new ConfigError(`Config file ${CONF_FILE} is not found`); | ||
} else { | ||
// don't check for unmapped files if config file does not exists | ||
failureConditions.unmapped_files = false; | ||
// settings to use if allowed to run with no config | ||
return { | ||
auditDiscovered: true, | ||
discoveryPatterns: DEFAULT_PATTERNS, | ||
mappedFiles: null, | ||
failureConditions: { | ||
...DEFAULT_FAILURE_CONDITIONS, | ||
unmapped_files: false, | ||
}, | ||
}; | ||
} | ||
} | ||
const audit = readBranchConfig( | ||
branchName, | ||
parseYaml(rootDir, CONF_FILE), | ||
confFilePath | ||
); | ||
if (typeof audit.discovery === "boolean") { | ||
@@ -71,0 +78,0 @@ if (audit.discovery) { |
137964
2980