mirror of
https://github.com/actions/github-script.git
synced 2026-02-08 03:57:27 +00:00
Avoid setting baseURL if the input is not provided
This commit is contained in:
parent
85717e4e3b
commit
d09af7480d
2 changed files with 9 additions and 4 deletions
6
dist/index.js
vendored
6
dist/index.js
vendored
|
|
@ -35509,9 +35509,11 @@ async function main() {
|
||||||
userAgent: userAgent || undefined,
|
userAgent: userAgent || undefined,
|
||||||
previews: previews ? previews.split(',') : undefined,
|
previews: previews ? previews.split(',') : undefined,
|
||||||
retry: retryOpts,
|
retry: retryOpts,
|
||||||
request: requestOpts,
|
request: requestOpts
|
||||||
baseUrl: baseUrl || lib_github.context.apiUrl
|
|
||||||
};
|
};
|
||||||
|
if (baseUrl) {
|
||||||
|
opts.baseUrl = baseUrl;
|
||||||
|
}
|
||||||
const github = (0,lib_github.getOctokit)(token, opts, plugin_retry_dist_node.retry, dist_node.requestLog);
|
const github = (0,lib_github.getOctokit)(token, opts, plugin_retry_dist_node.retry, dist_node.requestLog);
|
||||||
const script = core.getInput('script', { required: true });
|
const script = core.getInput('script', { required: true });
|
||||||
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
|
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,11 @@ async function main(): Promise<void> {
|
||||||
userAgent: userAgent || undefined,
|
userAgent: userAgent || undefined,
|
||||||
previews: previews ? previews.split(',') : undefined,
|
previews: previews ? previews.split(',') : undefined,
|
||||||
retry: retryOpts,
|
retry: retryOpts,
|
||||||
request: requestOpts,
|
request: requestOpts
|
||||||
baseUrl: baseUrl || context.apiUrl
|
}
|
||||||
|
|
||||||
|
if (baseUrl) {
|
||||||
|
opts.baseUrl = baseUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
const github = getOctokit(token, opts, retry, requestLog)
|
const github = getOctokit(token, opts, retry, requestLog)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue