Skip to content

Commit

Permalink
fix: parameters and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkor committed Dec 17, 2024
1 parent 1445ed9 commit 3ec7dcf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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: |
Expand All @@ -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 }}
```
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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
);
Expand Down

0 comments on commit 3ec7dcf

Please sign in to comment.