Skip to content

Commit

Permalink
feat: add optional project-id input parameter
Browse files Browse the repository at this point in the history
PAP-1244 #code-review
  • Loading branch information
bramkor committed Dec 1, 2024
1 parent 5679a34 commit 349e00a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface Config {
module?: string;
crawlerUrls?: string[];
fileId?: string;
projectId?: string;
hostsFilter?: string[];
tests?: TestType[];
}
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<RequestExclusion>('exclude_entry_points');
Expand Down Expand Up @@ -90,6 +91,7 @@ if (restartScanID) {
if (
!(
fileId ||
projectId ||
crawlerUrls ||
discoveryTypesIn ||
module_in ||
Expand All @@ -116,6 +118,7 @@ if (restartScanID) {
module,
...(crawlerUrls ? { crawlerUrls } : {}),
...(fileId ? { fileId } : {}),
...(projectId ? { projectId } : {}),
...(uniqueTests?.length ? { tests: uniqueTests } : {}),
...(hostsFilter?.length ? { hostsFilter } : {}),
...(excludedEntryPoints?.length || excludedParams?.length
Expand Down

0 comments on commit 349e00a

Please sign in to comment.