Avoid setting baseUrl to undefined when input is not provided

This commit is contained in:
Josh Gross
2023-11-17 11:59:30 -05:00
parent e69ef5462f
commit d319f8f5b5
3 changed files with 88 additions and 4 deletions

View File

@@ -44,8 +44,13 @@ async function main(): Promise<void> {
userAgent: userAgent || undefined,
previews: previews ? previews.split(',') : undefined,
retry: retryOpts,
request: requestOpts,
baseUrl: baseUrl || undefined
request: requestOpts
}
// Setting `baseUrl` to undefined will prevent the default value from being used
// https://github.com/actions/github-script/issues/436
if (baseUrl) {
opts.baseUrl = baseUrl
}
const github = getOctokit(token, opts, retry, requestLog)