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

Stop action when no scans are enabled #38

Merged
merged 7 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 0 deletions .github/workflows/verify-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
push:
branches:
- main
pull_request:
branches:
- '*'

jobs:
check-dist:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Detect new vulnerabilities
uses: AikidoSec/[email protected].9
uses: AikidoSec/[email protected].10
with:
secret-key: ${{ secrets.AIKIDO_SECRET_KEY }}
fail-on-timeout: true
Expand Down
5 changes: 5 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ async function run() {
}
core.info(`secret key not set.`);
}
if (failOnDependencyScan === 'false' && failOnIacScan === 'false' && failOnSastScan === 'false') {
core.setOutput('output', STATUS_FAILED);
core.setFailed(`You must enable at least one of the scans.`);
return;
}
const scanId = await (0, api_1.startScan)(secretKey, startScanPayload);
core.info(`successfully started a scan with id: "${scanId}"`);
const getScanCompletionStatus = (0, api_1.getScanStatus)(secretKey, scanId);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ async function run(): Promise<void> {
core.info(`secret key not set.`);
}

if (failOnDependencyScan === 'false' && failOnIacScan === 'false' && failOnSastScan === 'false') {
core.setOutput('output', STATUS_FAILED);
core.setFailed(`You must enable at least one of the scans.`);
return;
}

const scanId = await startScan(secretKey, startScanPayload);

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