From ea121b86f93250013496c8ae6b1852ce432aed23 Mon Sep 17 00:00:00 2001 From: Rob Anderson Date: Fri, 20 Oct 2023 10:16:28 -0600 Subject: [PATCH] add base-url option --- action.yml | 3 +++ src/main.ts | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 858c88f..742549b 100644 --- a/action.yml +++ b/action.yml @@ -29,6 +29,9 @@ inputs: retry-exempt-status-codes: description: A comma separated list of status codes that will NOT be retried e.g. "400,500". No effect unless `retries` is set default: 400,401,403,404,422 # from https://github.com/octokit/plugin-retry.js/blob/9a2443746c350b3beedec35cf26e197ea318a261/src/index.ts#L14 + base-url: + description: The root of the API URL of the GHES instance to which to connect. + required: false outputs: result: description: The return value of the script, stringified with `JSON.stringify` diff --git a/src/main.ts b/src/main.ts index 658cee0..f3c41b0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,6 +18,7 @@ main().catch(handleError) type Options = { log?: Console userAgent?: string + baseUrl?: string previews?: string[] retry?: RetryOptions request?: RequestRequestOptions @@ -28,6 +29,7 @@ async function main(): Promise { const debug = core.getBooleanInput('debug') const userAgent = core.getInput('user-agent') const previews = core.getInput('previews') + const baseUrl = core.getInput('base-url') const retries = parseInt(core.getInput('retries')) const exemptStatusCodes = parseNumberArray( core.getInput('retry-exempt-status-codes') @@ -43,7 +45,8 @@ async function main(): Promise { userAgent: userAgent || undefined, previews: previews ? previews.split(',') : undefined, retry: retryOpts, - request: requestOpts + request: requestOpts, + baseUrl: baseUrl || undefined } const github = getOctokit(token, opts, retry, requestLog)