Skip to content

Commit

Permalink
fix: prevent sending empty strings (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
derevnjuk authored Mar 30, 2023
1 parent 7406ee5 commit aa74afb
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const getArray = <T = string>(inputName: string): T[] | undefined => {
}
};

const apiToken = core.getInput('api_token');
const apiToken = core.getInput('api_token', { required: true });
const restartScanID = core.getInput('restart_scan');
const name = core.getInput('name');
const fileId = core.getInput('file_id');
Expand Down Expand Up @@ -114,14 +114,18 @@ if (restartScanID) {
name,
discoveryTypes,
module,
crawlerUrls,
fileId,
hostsFilter,
tests: uniqueTests,
exclusions: {
requests: excludedEntryPoints,
params: excludedParams
}
...(crawlerUrls ? { crawlerUrls } : {}),
...(fileId ? { fileId } : {}),
...(uniqueTests?.length ? { tests: uniqueTests } : {}),
...(hostsFilter?.length ? { hostsFilter } : {}),
...(excludedEntryPoints?.length || excludedParams?.length
? {
exclusions: {
requests: excludedEntryPoints,
params: excludedParams
}
}
: {})
};

try {
Expand Down

0 comments on commit aa74afb

Please sign in to comment.