Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Sigint 375 detect action produces a type error with latest version 8.2.0 #49

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b5b148a
feat SIGINT-375: adding logs.
kiranblackduck Feb 21, 2023
e308361
feat SIGINT-375: adding logs.
kiranblackduck Feb 21, 2023
8d81fbc
feat SIGINT-375: adding logs.
kiranblackduck Feb 21, 2023
079d887
feat SIGINT-375: adding logs.
kiranblackduck Feb 21, 2023
114cedf
feat SIGINT-375: adding logs.
kiranblackduck Feb 21, 2023
a271553
feat SIGINT-375: adding logs.
kiranblackduck Feb 21, 2023
c0b527b
feat SIGINT-375: adding logs.
kiranblackduck Feb 21, 2023
e0fadf7
feat SIGINT-375: adding logs.
kiranblackduck Feb 21, 2023
0671e47
feat SIGINT-375: adding logs.
kiranblackduck Feb 21, 2023
6289c2f
feat SIGINT-375: adding logs.
kiranblackduck Feb 21, 2023
8e9de47
feat: adding logs.
kiranblackduck Feb 21, 2023
ea8d25b
feat: adding logs.
kiranblackduck Feb 21, 2023
571ab5e
feat: adding logs.
kiranblackduck Feb 21, 2023
f6ff4c3
feat: adding logs.
kiranblackduck Feb 21, 2023
206cf01
feat: adding logs.
kiranblackduck Feb 21, 2023
178d817
feat: adding logs.
kiranblackduck Feb 21, 2023
1f9eaf7
feat: adding logs.
kiranblackduck Feb 21, 2023
4ed49aa
feat: adding logs.
kiranblackduck Feb 21, 2023
cd17e3d
feat: adding logs.
kiranblackduck Feb 21, 2023
3d47ccf
feat:
kiranblackduck Feb 22, 2023
e8fbe37
feat:added validation for violatedPolicies
kiranblackduck Feb 22, 2023
9091a21
feat:added validation for violatedPolicies
kiranblackduck Feb 22, 2023
c3349b8
feat:added validation for violatedPolicies
kiranblackduck Feb 22, 2023
3d4b207
feat:added validation for violatedPolicies
kiranblackduck Feb 22, 2023
0eb1859
feat:added validation for violatedPolicies
kiranblackduck Feb 22, 2023
c7ffce3
feat:added validation for violatedPolicies
kiranblackduck Feb 22, 2023
88f0767
feat:added validation for violatedPolicies
kiranblackduck Mar 15, 2023
1abca26
feat:added validation for violatedPolicies
kiranblackduck Mar 15, 2023
a630f83
feat:added validation for violatedPolicies
kiranblackduck Mar 15, 2023
4efa715
feat:added validation for violatedPolicies
kiranblackduck Mar 15, 2023
2a66a83
feat:added validation for violatedPolicies
kiranblackduck Mar 15, 2023
a85c2bf
feat:added validation for violatedPolicies
kiranblackduck Mar 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ function createRapidScanReportString(policyViolations, policyCheckWillFail) {
}
exports.createRapidScanReportString = createRapidScanReportString;
function createComponentRow(component) {
const violatedPolicies = component.violatedPolicies.join('<br/>');
const violatedPolicies = component.violatedPolicies === undefined ? '' : component.violatedPolicies.join('<br/>');
const componentInViolation = (component === null || component === void 0 ? void 0 : component.href) ? `[${component.name}](${component.href})` : component.name;
const componentLicenses = component.licenses.map(license => `${license.violatesPolicy ? ':x: &nbsp; ' : ''}[${license.name}](${license.href})`).join('<br/>');
const vulnerabilities = component.vulnerabilities.map(vulnerability => `${vulnerability.violatesPolicy ? ':x: &nbsp; ' : ''}[${vulnerability.name}](${vulnerability.href})${vulnerability.cvssScore && vulnerability.severity ? ` ${vulnerability.severity}: CVSS ${vulnerability.cvssScore}` : ''}`).join('<br/>');
Expand Down Expand Up @@ -758,6 +758,7 @@ function runWithPolicyCheck(blackduckPolicyCheck) {
(0, core_1.debug)(`Policy Violations Present: ${hasPolicyViolations}`);
const failureConditionsMet = detectExitCode === exit_codes_1.POLICY_SEVERITY || inputs_1.FAIL_ON_ALL_POLICY_SEVERITIES;
const rapidScanReport = yield (0, reporting_1.createRapidScanReportString)(policyViolations, hasPolicyViolations && failureConditionsMet);
(0, core_1.info)(`Policy Violations policyViolations: ${JSON.stringify(policyViolations)}`);
if ((0, github_context_1.isPullRequest)()) {
(0, core_1.info)('This is a pull request, commenting...');
(0, comment_1.commentOnPR)(rapidScanReport);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/detect/reporting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function createRapidScanReportString(policyViolations: IRapidScanRe
}

function createComponentRow(component: IComponentReport): string {
const violatedPolicies = component.violatedPolicies.join('<br/>')
const violatedPolicies = component.violatedPolicies === undefined ? '' : component.violatedPolicies.join('<br/>')
const componentInViolation = component?.href ? `[${component.name}](${component.href})` : component.name
const componentLicenses = component.licenses.map(license => `${license.violatesPolicy ? ':x: &nbsp; ' : ''}[${license.name}](${license.href})`).join('<br/>')
const vulnerabilities = component.vulnerabilities.map(vulnerability => `${vulnerability.violatesPolicy ? ':x: &nbsp; ' : ''}[${vulnerability.name}](${vulnerability.href})${vulnerability.cvssScore && vulnerability.severity ? ` ${vulnerability.severity}: CVSS ${vulnerability.cvssScore}` : ''}`).join('<br/>')
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export async function runWithPolicyCheck(blackduckPolicyCheck: GitHubCheck): Pro

const failureConditionsMet = detectExitCode === POLICY_SEVERITY || FAIL_ON_ALL_POLICY_SEVERITIES
const rapidScanReport = await createRapidScanReportString(policyViolations, hasPolicyViolations && failureConditionsMet)

info(`Policy Violations policyViolations: ${JSON.stringify(policyViolations)}`)
if (isPullRequest()) {
info('This is a pull request, commenting...')
commentOnPR(rapidScanReport)
Expand Down