Skip to content

Add Base URL as part options #151

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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 @@ -23,6 +23,9 @@ inputs:
result-encoding:
description: Either "string" or "json" (default "json")—how the result will be encoded
default: json
baseUrl:
description: The base URL for the GitHub API service instance
default: https://api.github.com
outputs:
result:
description: The return value of the script, stringified with `JSON.stringify`
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ type Options = {
log?: Console
userAgent?: string
previews?: string[]
baseUrl?: string
}

async function main(): Promise<void> {
const token = core.getInput('github-token', {required: true})
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})
Expand Down