diff --git a/README.md b/README.md index ba9e436..38c339e 100644 --- a/README.md +++ b/README.md @@ -46,17 +46,17 @@ More information is available on Bright’s: _Example:_ `api_token: ${{ secrets.BRIGHTSEC_TOKEN }}` -### `discovery` +### `discovery_id` **Required**. Discovery ID to stop. _Example:_ `discovery: ${{ steps.start.outputs.id }}` -### `project` +### `project_id` **Required**. Project ID for the Discovery. -_Example:_ `project: gBAh2n9BD9ps7FVQXbLWXv` +_Example:_ `project_id: ${{ vars.PROJECT_ID }}` ## Usage Example @@ -73,6 +73,7 @@ start_and_stop_discovery: with: api_token: ${{ secrets.BRIGHTSEC_TOKEN }} name: GitHub scan ${{ github.sha }} + project_id: ${{ vars.PROJECT_ID }} discovery_types: | [ "crawler", "archive" ] crawler_urls: | @@ -95,5 +96,6 @@ start_and_stop_discovery: uses: NeuraLegion/stop-discovery@master with: api_token: ${{ secrets.BRIGHTSEC_TOKEN }} - discovery: ${{ steps.start.outputs.id }} + discovery_id: ${{ steps.start.outputs.id }} + project_id: ${{ vars.PROJECT_ID }} ``` diff --git a/action.yml b/action.yml index eb1660a..d28c855 100644 --- a/action.yml +++ b/action.yml @@ -7,10 +7,10 @@ inputs: api_token: description: 'Api Token. You can generate it in Organization section' required: true - discovery: + discovery_id: description: 'Discovery ID to wait for' required: true - project: + project_id: description: 'ID of the project that the discovery belongs to' required: true hostname: diff --git a/src/index.ts b/src/index.ts index aebff96..5421497 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,8 +2,8 @@ import * as core from '@actions/core'; import * as rm from 'typed-rest-client/RestClient'; const apiToken = core.getInput('api_token'); -const discoveryId = core.getInput('discovery'); -const projectId = core.getInput('project'); +const discoveryId = core.getInput('discovery_id'); +const projectId = core.getInput('project_id'); const hostname = core.getInput('hostname'); const baseUrl = hostname ? `https://${hostname}` : 'https://app.brightsec.com'; @@ -18,7 +18,7 @@ async function stopDiscovery(uuid: string) { action: 'stop' }; const restRes = await restc.update( - `api/v2/projecs/${projectId}/discoveries/${uuid}`, + `api/v2/projects/${projectId}/discoveries/${uuid}`, payload, options );