🔧 baseUrl config

The `baseUrl`, which could be taken as an input, is required to use a custom GitHub Enterprise URL, for example.
This commit is contained in:
marocchino 2023-04-21 11:31:12 +09:00
parent f2c5111552
commit 292f33e766
No known key found for this signature in database
GPG key ID: 326883DCCAF7FFEA
4 changed files with 41 additions and 1 deletions

View file

@ -8,6 +8,7 @@ export const pullRequestNumber =
context?.payload?.pull_request?.number ||
+core.getInput("number", {required: false})
export const baseUrl = core.getInput("base_url", {required: true})
export const repo = buildRepo()
export const header = core.getInput("header", {required: false})
export const append = core.getBooleanInput("append", {required: true})

View file

@ -3,6 +3,7 @@ import * as github from "@actions/github"
import {
append,
getBody,
baseUrl,
deleteOldComment,
githubToken,
header,
@ -56,7 +57,7 @@ async function run(): Promise<undefined> {
throw new Error("hide and hide_and_recreate cannot be both set to true")
}
const octokit = github.getOctokit(githubToken)
const octokit = github.getOctokit(githubToken, {baseUrl})
const previous = await findPreviousComment(
octokit,
repo,