Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add base-url option #429

Merged
merged 4 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
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: The root of the API URL of the GHES instance to which to connect.
robandpdx marked this conversation as resolved.
Show resolved Hide resolved
required: false
outputs:
result:
description: The return value of the script, stringified with `JSON.stringify`
Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
robandpdx marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
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
Loading