Configure baseUrl in octokit initialisation (#91)
Make the action work for GHES by passing `GITHUB_API_URL` environment variable to octokit initialisation.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import {getInput, setFailed} from '@actions/core'
|
||||
import {context} from '@actions/github'
|
||||
import {Input} from './input'
|
||||
|
||||
@@ -15,7 +15,8 @@ export function deletePackageVersion(
|
||||
token: string
|
||||
): Observable<boolean> {
|
||||
const octokit = new Octokit({
|
||||
auth: token
|
||||
auth: token,
|
||||
baseUrl: process.env.GITHUB_API_URL || 'https://api.github.com'
|
||||
})
|
||||
const package_version_id = +packageVersionId
|
||||
const package_type: PackageType = packageType as PackageType
|
||||
|
||||
@@ -31,7 +31,8 @@ export function getOldestVersions(
|
||||
token: string
|
||||
): Observable<RestQueryInfo> {
|
||||
const octokit = new Octokit({
|
||||
auth: token
|
||||
auth: token,
|
||||
baseUrl: process.env.GITHUB_API_URL || 'https://api.github.com'
|
||||
})
|
||||
const package_type: PackageType = packageType as PackageType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user