Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
run: |
apt-get update
apt-get install -y rsync
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci -q
- name: Build release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
container: node:20
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci && npm install -g @vercel/ncc
- name: Build release
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ ID of the created discovery.
steps:
- name: Start Bright Discovery
id: start
uses: NeuraLegion/run-scan@release
uses: NeuraLegion/run-discovery@v1.1
with:
api_token: ${{ secrets.BRIGHTSEC_TOKEN }}
name: GitHub discovery ${{ github.sha }}
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
description: 'Discovery ID to restart'
required: false
hostname:
description: 'Hostname. Default is app.brighsec.com'
description: 'Hostname. Default is app.brightsec.com'
required: false
project_id:
description: 'Project ID for Discovery'
Expand All @@ -26,7 +26,7 @@ inputs:
description: 'IDs of repeaters needed for the discovery'
required: false
discovery_types:
description: 'Array of discovery types. Can be: archive, crawler, oas'
description: 'Array of discovery types. Possible values: archive, crawler, oas, graphql'
required: false
crawler_urls:
description: 'Crawler URLs'
Expand Down
10 changes: 6 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,24 @@ function validateFileId(
if (
!(
discoveryTypes.includes(Discovery.OAS) ||
discoveryTypes.includes(Discovery.ARCHIVE)
discoveryTypes.includes(Discovery.ARCHIVE) ||
discoveryTypes.includes(Discovery.GRAPHQL)
)
) {
throw new Error(
`Invalid discovery. When specifying a file ID, the discovery type must be either "oas" or "archive". The current discovery types are: ${discoveryTypes.join(
`Invalid discovery. When specifying a file ID, the discovery type must be either "oas" or "archive" or "graphql". The current discovery types are: ${discoveryTypes.join(
', '
)}`
);
}
} else {
if (
discoveryTypes.includes(Discovery.OAS) ||
discoveryTypes.includes(Discovery.ARCHIVE)
discoveryTypes.includes(Discovery.ARCHIVE) ||
discoveryTypes.includes(Discovery.GRAPHQL)
) {
throw new Error(
`Invalid discovery. When setting a discovery type to either "oas" or "archive", the file ID must be provided.`
`Invalid discovery. When setting a discovery type to either "oas" or "archive" or "graphql", the file ID must be provided.`
);
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/discovery.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export enum Discovery {
ARCHIVE = 'archive',
CRAWLER = 'crawler',
GRAPHQL = 'graphql',
OAS = 'oas'
}

Expand Down Expand Up @@ -33,8 +34,8 @@ const disallowDiscoveryCombination = (discoveryTypes: Set<Discovery>): void => {

throw new Error(
`The discovery list cannot include both ${
firstInvalidCombination?.[0]
} and any of ${firstInvalidCombination?.[1].join(', ')} simultaneously.`
firstInvalidCombination[0]
} and any of ${firstInvalidCombination[1].join(', ')} simultaneously.`
);
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Discovery } from './discovery';
import { Config, RequestExclusion, validateConfig } from './config';
import { HttpClient } from '@actions/http-client';
import { Discovery } from './discovery';
import * as core from '@actions/core';
import { HttpClient } from '@actions/http-client';

interface DiscoveryID {
id: string;
Expand Down