Skip to content

Commit

Permalink
plugin: adds github action to integrate with CI/CD flow
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwiniag committed Oct 12, 2024
1 parent 609b0f5 commit 70377d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions .github/actions/gokakashi-scan/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ inputs:
description: 'The publish path for the scan report'
required: false
default: 'report_private'
inputs:
fail_on_severity:
description: 'Comma-separated list of severity levels to fail the job on (e.g., CRITICAL,HIGH)'
required: false
default: 'CRITICAL'
fail_on_severity:
description: 'Comma-separated list of severity levels to fail the job on (e.g., CRITICAL,HIGH)'
required: false
default: 'CRITICAL'


outputs:
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/gokakashi-scan/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async function run() {
// Step 3: Check the scan report for vulnerabilities
const reportResponse = await fetch(reportUrl);
const reportData = await reportResponse.json();
const failOnSeverity = core.getInput('fail_on_severity'); // Get user-defined severity level
const failOnSeverity = getInput('fail_on_severity'); // Get user-defined severity level
// const hasVulnsToFail = reportData.vulnerabilities.some(vuln => vuln.severity === failOnSeverity);

if (failOnSeverity) {
Expand All @@ -78,7 +78,7 @@ async function run() {
severitiesToFailOn.includes(vuln.severity)
);
if (hasVulnsToFail) {
core.setFailed(`Vulnerabilities found with severity: ${severitiesToFailOn.join(', ')}`);
setFailed(`Vulnerabilities found with severity: ${severitiesToFailOn.join(', ')}`);
} else {
console.log(`No vulnerabilities found with severity: ${severitiesToFailOn.join(', ')}`);
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
image_name: 'hasura/graphql-engine:v2.35.0'
severity: 'CRITICAL,HIGH'
publish: 'report_private'
fail_on_severity: 'HIGH,CRITICAL'
# fail_on_severity: 'HIGH,CRITICAL'

- name: Log the Scan Report URL
run: |
Expand Down

0 comments on commit 70377d5

Please sign in to comment.