Add Base URL as part options

This commit is contained in:
Shamil Nunhuck 2021-06-09 22:34:22 +01:00 committed by GitHub
parent a3e7071a34
commit abbc317338
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,6 +12,7 @@ type Options = {
log?: Console
userAgent?: string
previews?: string[]
baseUrl?: string
}
async function main(): Promise<void> {
@ -19,11 +20,13 @@ async function main(): Promise<void> {
const debug = core.getInput('debug')
const userAgent = core.getInput('user-agent')
const previews = core.getInput('previews')
const baseUrl = core.getInput('baseUrl')
const opts: Options = {}
if (debug === 'true') opts.log = console
if (userAgent != null) opts.userAgent = userAgent
if (previews != null) opts.previews = previews.split(',')
if (baseUrl != null) opts.baseUrl = baseUrl
const github = getOctokit(token, opts)
const script = core.getInput('script', {required: true})