diff --git a/README.md b/README.md index 78189cd..f0110e2 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,12 @@ _Example:_ `name: GitHub scan ${{ github.sha }}` _Example:_ `api_token: ${{ secrets.NEURALEGION_TOKEN }}` +### `project_id` + +Provide project-id if you want to run a scan for a specific project. If you don't provide project-id, scan will run under Default project. + +_Example:_ `project_id: gBAh2n9BD9ps7FVQXbLWXv` + ### `restart_scan` **Required** when restarting an existing scan by its ID. You can get the scan ID in the Scans section in [the Bright app](https://app.neuralegion.com/login). diff --git a/src/config.ts b/src/config.ts index e5b7f01..6de7586 100644 --- a/src/config.ts +++ b/src/config.ts @@ -19,6 +19,7 @@ export interface Config { module?: string; crawlerUrls?: string[]; fileId?: string; + projectId?: string; hostsFilter?: string[]; tests?: TestType[]; } diff --git a/src/index.ts b/src/index.ts index 3fd02f7..964f2d8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -24,6 +24,7 @@ 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'); +const projectId = core.getInput('project_id'); const crawlerUrls = getArray('crawler_urls'); const excludedParams = getArray('exclude_params'); const excludedEntryPoints = getArray('exclude_entry_points'); @@ -90,6 +91,7 @@ if (restartScanID) { if ( !( fileId || + projectId || crawlerUrls || discoveryTypesIn || module_in || @@ -116,6 +118,7 @@ if (restartScanID) { module, ...(crawlerUrls ? { crawlerUrls } : {}), ...(fileId ? { fileId } : {}), + ...(projectId ? { projectId } : {}), ...(uniqueTests?.length ? { tests: uniqueTests } : {}), ...(hostsFilter?.length ? { hostsFilter } : {}), ...(excludedEntryPoints?.length || excludedParams?.length