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:
Anupam
2023-03-02 19:56:14 +05:30
committed by GitHub
parent ba4d22f251
commit b9ed39f728
8 changed files with 161 additions and 6 deletions
-1
View File
@@ -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'
+2 -1
View File
@@ -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
+2 -1
View File
@@ -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