diff --git a/action.yml b/action.yml index 59a1ab789..5cacb2121 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,9 @@ inputs: result-encoding: description: Either "string" or "json" (default "json")—how the result will be encoded default: json + baseUrl: + description: The base URL for the GitHub API service instance + default: https://api.github.com outputs: result: description: The return value of the script, stringified with `JSON.stringify` diff --git a/src/main.ts b/src/main.ts index c0668c626..0265e5a3c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,6 +12,7 @@ type Options = { log?: Console userAgent?: string previews?: string[] + baseUrl?: string } async function main(): Promise { @@ -19,11 +20,13 @@ async function main(): Promise { const debug = core.getInput('debug') const userAgent = core.getInput('user-agent') const previews = core.getInput('previews') + const baseUrl = core.getInput('baseUrl') const opts: Options = {} if (debug === 'true') opts.log = console if (userAgent != null) opts.userAgent = userAgent if (previews != null) opts.previews = previews.split(',') + if (baseUrl != null) opts.baseUrl = baseUrl const github = getOctokit(token, opts) const script = core.getInput('script', {required: true})