Avoid setting `baseUrl` to undefined when input is not provided · actions/github-script@d319f8f · GitHub
Skip to content

Commit d319f8f

Browse files
committed
Avoid setting baseUrl to undefined when input is not provided
1 parent e69ef54 commit d319f8f

3 files changed

Lines changed: 88 additions & 4 deletions

File tree

.github/workflows/integration.yml

Lines changed: 75 additions & 0 deletions

dist/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35509,9 +35509,13 @@ async function main() {
3550935509
userAgent: userAgent || undefined,
3551035510
previews: previews ? previews.split(',') : undefined,
3551135511
retry: retryOpts,
35512-
request: requestOpts,
35513-
baseUrl: baseUrl || undefined
35512+
request: requestOpts
3551435513
};
35514+
// Setting `baseUrl` to undefined will prevent the default value from being used
35515+
// https://github.com/actions/github-script/issues/436
35516+
if (baseUrl) {
35517+
opts.baseUrl = baseUrl;
35518+
}
3551535519
const github = (0,lib_github.getOctokit)(token, opts, plugin_retry_dist_node.retry, dist_node.requestLog);
3551635520
const script = core.getInput('script', { required: true });
3551735521
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.

src/main.ts

Lines changed: 7 additions & 2 deletions

0 commit comments

Comments
 (0)