Skip to content

Commit e9aa8e4

Browse files
Merge pull request #38 from AikidoSec/feat/fail-scan-when-no-scan-is-enabled
Stop action when no scans are enabled
2 parents 6bb94f1 + 32d707b commit e9aa8e4

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

.github/workflows/verify-build.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
push:
88
branches:
99
- main
10+
pull_request:
11+
branches:
12+
- '*'
1013

1114
jobs:
1215
check-dist:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout code
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222

2323
- name: Detect new vulnerabilities
24-
uses: AikidoSec/[email protected].9
24+
uses: AikidoSec/[email protected].10
2525
with:
2626
secret-key: ${{ secrets.AIKIDO_SECRET_KEY }}
2727
fail-on-timeout: true

dist/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ async function run() {
172172
}
173173
core.info(`secret key not set.`);
174174
}
175+
if (failOnDependencyScan === 'false' && failOnIacScan === 'false' && failOnSastScan === 'false') {
176+
core.setOutput('output', STATUS_FAILED);
177+
core.setFailed(`You must enable at least one of the scans.`);
178+
return;
179+
}
175180
const scanId = await (0, api_1.startScan)(secretKey, startScanPayload);
176181
core.info(`successfully started a scan with id: "${scanId}"`);
177182
const getScanCompletionStatus = (0, api_1.getScanStatus)(secretKey, scanId);

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ async function run(): Promise<void> {
7171
core.info(`secret key not set.`);
7272
}
7373

74+
if (failOnDependencyScan === 'false' && failOnIacScan === 'false' && failOnSastScan === 'false') {
75+
core.setOutput('output', STATUS_FAILED);
76+
core.setFailed(`You must enable at least one of the scans.`);
77+
return;
78+
}
79+
7480
const scanId = await startScan(secretKey, startScanPayload);
7581

7682
core.info(`successfully started a scan with id: "${scanId}"`);

0 commit comments

Comments
 (0)