diff --git a/dist/index.js b/dist/index.js index df02a14..7b0faee 100644 --- a/dist/index.js +++ b/dist/index.js @@ -85680,8 +85680,10 @@ async function validateVeracodeApiCreds(inputs) { owner: repo[0], repo: repo[1], }; + const baseUrl = process.env.GITHUB_API_URL || 'https://api.github.com'; const octokit = new rest_1.Octokit({ auth: inputs.token, + baseUrl: baseUrl }); const checkStatic = { owner: ownership.owner, @@ -85741,8 +85743,10 @@ async function validatePolicyName(inputs) { owner: repo[0], repo: repo[1], }; + const baseUrl = process.env.GITHUB_API_URL || 'https://api.github.com'; const octokit = new rest_1.Octokit({ auth: inputs.token, + baseUrl: baseUrl }); const checkStatic = { owner: ownership.owner, @@ -86243,8 +86247,10 @@ async function preparePipelineResults(inputs) { check_run_id: inputs.check_run_id, status: Checks.Status.Completed, }; + const baseUrl = process.env.GITHUB_API_URL || 'https://api.github.com'; const octokit = new rest_1.Octokit({ auth: inputs.token, + baseUrl: baseUrl }); if (!(0, inputs_1.vaildateScanResultsActionInput)(inputs)) { core.setFailed('token, check_run_id and source_repository are required.'); @@ -86468,8 +86474,10 @@ const check_service_1 = __nccwpck_require__(42450); const app_config_1 = __importDefault(__nccwpck_require__(971)); const http = __importStar(__nccwpck_require__(37542)); async function preparePolicyResults(inputs) { + const baseUrl = process.env.GITHUB_API_URL || 'https://api.github.com'; const octokit = new rest_1.Octokit({ auth: inputs.token, + baseUrl: baseUrl }); const repo = inputs.source_repository.split('/'); const ownership = { diff --git a/dist/services/application-service.js b/dist/services/application-service.js index 575758e..f475041 100644 --- a/dist/services/application-service.js +++ b/dist/services/application-service.js @@ -161,8 +161,10 @@ async function validateVeracodeApiCreds(inputs) { owner: repo[0], repo: repo[1], }; + const baseUrl = process.env.GITHUB_API_URL || 'https://api.github.com'; const octokit = new rest_1.Octokit({ auth: inputs.token, + baseUrl: baseUrl }); const checkStatic = { owner: ownership.owner, @@ -222,8 +224,10 @@ async function validatePolicyName(inputs) { owner: repo[0], repo: repo[1], }; + const baseUrl = process.env.GITHUB_API_URL || 'https://api.github.com'; const octokit = new rest_1.Octokit({ auth: inputs.token, + baseUrl: baseUrl }); const checkStatic = { owner: ownership.owner, diff --git a/dist/services/pipeline-results-service.js b/dist/services/pipeline-results-service.js index a5e35f6..9c7e883 100644 --- a/dist/services/pipeline-results-service.js +++ b/dist/services/pipeline-results-service.js @@ -223,8 +223,10 @@ async function preparePipelineResults(inputs) { check_run_id: inputs.check_run_id, status: Checks.Status.Completed, }; + const baseUrl = process.env.GITHUB_API_URL || 'https://api.github.com'; const octokit = new rest_1.Octokit({ auth: inputs.token, + baseUrl: baseUrl }); if (!(0, inputs_1.vaildateScanResultsActionInput)(inputs)) { core.setFailed('token, check_run_id and source_repository are required.'); diff --git a/dist/services/policy-results-services.js b/dist/services/policy-results-services.js index 4047345..a022f45 100644 --- a/dist/services/policy-results-services.js +++ b/dist/services/policy-results-services.js @@ -47,8 +47,10 @@ const check_service_1 = require("./check-service"); const app_config_1 = __importDefault(require("../app-config")); const http = __importStar(require("../api/http-request")); async function preparePolicyResults(inputs) { + const baseUrl = process.env.GITHUB_API_URL || 'https://api.github.com'; const octokit = new rest_1.Octokit({ auth: inputs.token, + baseUrl: baseUrl }); const repo = inputs.source_repository.split('/'); const ownership = { diff --git a/src/services/application-service.ts b/src/services/application-service.ts index 4a4237e..a1fd4a3 100644 --- a/src/services/application-service.ts +++ b/src/services/application-service.ts @@ -139,9 +139,11 @@ export async function validateVeracodeApiCreds(inputs: Inputs): Promise { repo: repo[1], }; + const baseUrl = process.env.GITHUB_API_URL || 'https://api.github.com'; const octokit = new Octokit({ auth: inputs.token, + baseUrl: baseUrl }); const checkStatic: Checks.ChecksStatic = { diff --git a/src/services/pipeline-results-service.ts b/src/services/pipeline-results-service.ts index 816cdd9..889b394 100644 --- a/src/services/pipeline-results-service.ts +++ b/src/services/pipeline-results-service.ts @@ -228,8 +228,10 @@ export async function preparePipelineResults(inputs: Inputs): Promise { status: Checks.Status.Completed, }; + const baseUrl = process.env.GITHUB_API_URL || 'https://api.github.com'; const octokit = new Octokit({ auth: inputs.token, + baseUrl: baseUrl }); // When the action is preparePolicyResults, need to make sure token, diff --git a/src/services/policy-results-services.ts b/src/services/policy-results-services.ts index f4278cd..e701c33 100644 --- a/src/services/policy-results-services.ts +++ b/src/services/policy-results-services.ts @@ -10,8 +10,10 @@ import * as VeracodeApplication from '../namespaces/VeracodeApplication'; import * as http from '../api/http-request'; export async function preparePolicyResults(inputs: Inputs): Promise { + const baseUrl = process.env.GITHUB_API_URL || 'https://api.github.com'; const octokit = new Octokit({ auth: inputs.token, + baseUrl: baseUrl }); const repo = inputs.source_repository.split('/');