Skip to content

Commit

Permalink
Merge pull request #429 from robandpdx/add-base-url-option
Browse files Browse the repository at this point in the history
Add base-url option
  • Loading branch information
joshmgross committed Oct 31, 2023
2 parents 1f16022 + 5940a76 commit 6b5d3ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions action.yml
Expand Up @@ -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: An optional GitHub REST API URL to connect to a different GitHub instance. For example, https://my.github-enterprise-server.com/api/v3
required: false
outputs:
result:
description: The return value of the script, stringified with `JSON.stringify`
Expand Down
4 changes: 3 additions & 1 deletion dist/index.js
Expand Up @@ -15220,6 +15220,7 @@ async function main() {
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'));
const [retryOpts, requestOpts] = getRetryOptions(retries, exemptStatusCodes, utils.defaults);
Expand All @@ -15228,7 +15229,8 @@ async function main() {
userAgent: userAgent || undefined,
previews: previews ? previews.split(',') : undefined,
retry: retryOpts,
request: requestOpts
request: requestOpts,
baseUrl: baseUrl || undefined
};
const github = (0,lib_github.getOctokit)(token, opts, plugin_retry_dist_node/* retry */.XD, dist_node/* requestLog */.g);
const script = core.getInput('script', { required: true });
Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Expand Up @@ -18,6 +18,7 @@ main().catch(handleError)
type Options = {
log?: Console
userAgent?: string
baseUrl?: string
previews?: string[]
retry?: RetryOptions
request?: RequestRequestOptions
Expand All @@ -28,6 +29,7 @@ async function main(): Promise<void> {
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')
Expand All @@ -43,7 +45,8 @@ async function main(): Promise<void> {
userAgent: userAgent || undefined,
previews: previews ? previews.split(',') : undefined,
retry: retryOpts,
request: requestOpts
request: requestOpts,
baseUrl: baseUrl || undefined
}

const github = getOctokit(token, opts, retry, requestLog)
Expand Down

0 comments on commit 6b5d3ea

Please sign in to comment.