Adding baseUrl for GHE auth

This commit is contained in:
Leo Giovanetti
2021-12-03 18:47:02 -03:00
parent 8178b36b5a
commit 71cd64f865
9 changed files with 1349 additions and 8107 deletions
+2
View File
@@ -24,6 +24,7 @@ async function run(): Promise<void> {
)
// read in repository inputs
const baseUrl = core.getInput('baseUrl')
const token = core.getInput('token')
const owner = core.getInput('owner') || github.context.repo.owner
const repo = core.getInput('repo') || github.context.repo.repo
@@ -36,6 +37,7 @@ async function run(): Promise<void> {
const commitMode = core.getInput('commitMode') === 'true'
const result = await new ReleaseNotesBuilder(
baseUrl,
token,
repositoryPath,
owner,
+3 -1
View File
@@ -8,6 +8,7 @@ import {fillAdditionalPlaceholders} from './transform'
export class ReleaseNotesBuilder {
constructor(
private baseUrl: string | null,
private token: string | null,
private repositoryPath: string,
private owner: string | null,
@@ -40,7 +41,8 @@ export class ReleaseNotesBuilder {
// load octokit instance
const octokit = new Octokit({
auth: `token ${this.token || process.env.GITHUB_TOKEN}`
auth: `token ${this.token || process.env.GITHUB_TOKEN}`,
baseUrl: `${this.baseUrl || "https://api.github.com"}`
})
// ensure proper from <-> to tag range