Skip to content

Commit 7331a99

Browse files
committed
Deploying to release from @ 38dc8b6 🚀
1 parent ba2081d commit 7331a99

5 files changed

Lines changed: 21 additions & 15 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ ID of the created discovery.
196196
steps:
197197
- name: Start Bright Discovery
198198
id: start
199-
uses: NeuraLegion/run-scan@release
199+
uses: NeuraLegion/run-discovery@v1.1
200200
with:
201201
api_token: ${{ secrets.BRIGHTSEC_TOKEN }}
202202
name: GitHub discovery ${{ github.sha }}

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ inputs:
1111
description: 'Discovery ID to restart'
1212
required: false
1313
hostname:
14-
description: 'Hostname. Default is app.brighsec.com'
14+
description: 'Hostname. Default is app.brightsec.com'
1515
required: false
1616
project_id:
1717
description: 'Project ID for Discovery'
@@ -26,7 +26,7 @@ inputs:
2626
description: 'IDs of repeaters needed for the discovery'
2727
required: false
2828
discovery_types:
29-
description: 'Array of discovery types. Can be: archive, crawler, oas'
29+
description: 'Array of discovery types. Possible values: archive, crawler, oas, graphql'
3030
required: false
3131
crawler_urls:
3232
description: 'Crawler URLs'

dist/config.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ function validateCrawlerUrls(crawlerUrls, discoveryTypes) {
4545
function validateFileId(fileId, discoveryTypes) {
4646
if (fileId) {
4747
if (!(discoveryTypes.includes(discovery_1.Discovery.OAS) ||
48-
discoveryTypes.includes(discovery_1.Discovery.ARCHIVE))) {
49-
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(', ')}`);
48+
discoveryTypes.includes(discovery_1.Discovery.ARCHIVE) ||
49+
discoveryTypes.includes(discovery_1.Discovery.GRAPHQL))) {
50+
throw new Error(`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(', ')}`);
5051
}
5152
}
5253
else {
5354
if (discoveryTypes.includes(discovery_1.Discovery.OAS) ||
54-
discoveryTypes.includes(discovery_1.Discovery.ARCHIVE)) {
55-
throw new Error(`Invalid discovery. When setting a discovery type to either "oas" or "archive", the file ID must be provided.`);
55+
discoveryTypes.includes(discovery_1.Discovery.ARCHIVE) ||
56+
discoveryTypes.includes(discovery_1.Discovery.GRAPHQL)) {
57+
throw new Error(`Invalid discovery. When setting a discovery type to either "oas" or "archive" or "graphql", the file ID must be provided.`);
5658
}
5759
}
5860
}

dist/discovery.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var Discovery;
55
(function (Discovery) {
66
Discovery["ARCHIVE"] = "archive";
77
Discovery["CRAWLER"] = "crawler";
8+
Discovery["GRAPHQL"] = "graphql";
89
Discovery["OAS"] = "oas";
910
})(Discovery || (exports.Discovery = Discovery = {}));
1011
const validateDiscovery = (discoveryTypes) => {
@@ -27,7 +28,7 @@ const disallowDiscoveryCombination = (discoveryTypes) => {
2728
]);
2829
if (disallowedCombinations.length) {
2930
const [firstInvalidCombination] = disallowedCombinations;
30-
throw new Error(`The discovery list cannot include both ${firstInvalidCombination?.[0]} and any of ${firstInvalidCombination?.[1].join(', ')} simultaneously.`);
31+
throw new Error(`The discovery list cannot include both ${firstInvalidCombination[0]} and any of ${firstInvalidCombination[1].join(', ')} simultaneously.`);
3132
}
3233
};
3334
const disallowedDiscoveryCombinations = new Map([

dist/index.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ function validateCrawlerUrls(crawlerUrls, discoveryTypes) {
5252
function validateFileId(fileId, discoveryTypes) {
5353
if (fileId) {
5454
if (!(discoveryTypes.includes(discovery_1.Discovery.OAS) ||
55-
discoveryTypes.includes(discovery_1.Discovery.ARCHIVE))) {
56-
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(', ')}`);
55+
discoveryTypes.includes(discovery_1.Discovery.ARCHIVE) ||
56+
discoveryTypes.includes(discovery_1.Discovery.GRAPHQL))) {
57+
throw new Error(`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(', ')}`);
5758
}
5859
}
5960
else {
6061
if (discoveryTypes.includes(discovery_1.Discovery.OAS) ||
61-
discoveryTypes.includes(discovery_1.Discovery.ARCHIVE)) {
62-
throw new Error(`Invalid discovery. When setting a discovery type to either "oas" or "archive", the file ID must be provided.`);
62+
discoveryTypes.includes(discovery_1.Discovery.ARCHIVE) ||
63+
discoveryTypes.includes(discovery_1.Discovery.GRAPHQL)) {
64+
throw new Error(`Invalid discovery. When setting a discovery type to either "oas" or "archive" or "graphql", the file ID must be provided.`);
6365
}
6466
}
6567
}
@@ -84,6 +86,7 @@ var Discovery;
8486
(function (Discovery) {
8587
Discovery["ARCHIVE"] = "archive";
8688
Discovery["CRAWLER"] = "crawler";
89+
Discovery["GRAPHQL"] = "graphql";
8790
Discovery["OAS"] = "oas";
8891
})(Discovery || (exports.Discovery = Discovery = {}));
8992
const validateDiscovery = (discoveryTypes) => {
@@ -106,7 +109,7 @@ const disallowDiscoveryCombination = (discoveryTypes) => {
106109
]);
107110
if (disallowedCombinations.length) {
108111
const [firstInvalidCombination] = disallowedCombinations;
109-
throw new Error(`The discovery list cannot include both ${firstInvalidCombination?.[0]} and any of ${firstInvalidCombination?.[1].join(', ')} simultaneously.`);
112+
throw new Error(`The discovery list cannot include both ${firstInvalidCombination[0]} and any of ${firstInvalidCombination[1].join(', ')} simultaneously.`);
110113
}
111114
};
112115
const disallowedDiscoveryCombinations = new Map([
@@ -156,10 +159,10 @@ var __importStar = (this && this.__importStar) || (function () {
156159
};
157160
})();
158161
Object.defineProperty(exports, "__esModule", ({ value: true }));
159-
const discovery_1 = __nccwpck_require__(4180);
160162
const config_1 = __nccwpck_require__(1677);
161-
const http_client_1 = __nccwpck_require__(6255);
163+
const discovery_1 = __nccwpck_require__(4180);
162164
const core = __importStar(__nccwpck_require__(2186));
165+
const http_client_1 = __nccwpck_require__(6255);
163166
const getArray = (inputName) => {
164167
const input = core.getInput(inputName);
165168
try {

0 commit comments

Comments
 (0)