Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/src/github-api-helper.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/github-api-helper.ts')
-rw-r--r--src/github-api-helper.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/github-api-helper.ts b/src/github-api-helper.ts
index 86632f5..b6bfc13 100644
--- a/src/github-api-helper.ts
+++ b/src/github-api-helper.ts
@@ -7,6 +7,7 @@ import * as path from 'path'
import * as retryHelper from './retry-helper'
import * as toolCache from '@actions/tool-cache'
import {default as uuid} from 'uuid/v4'
+import {getServerApiUrl} from './url-helper'
const IS_WINDOWS = process.platform === 'win32'
@@ -84,7 +85,9 @@ export async function getDefaultBranch(
): Promise<string> {
return await retryHelper.execute(async () => {
core.info('Retrieving the default branch name')
- const octokit = github.getOctokit(authToken, {baseUrl: baseUrl})
+ const octokit = github.getOctokit(authToken, {
+ baseUrl: getServerApiUrl(baseUrl)
+ })
let result: string
try {
// Get the default branch from the repo info
@@ -125,7 +128,9 @@ async function downloadArchive(
commit: string,
baseUrl?: string
): Promise<Buffer> {
- const octokit = github.getOctokit(authToken, {baseUrl: baseUrl})
+ const octokit = github.getOctokit(authToken, {
+ baseUrl: getServerApiUrl(baseUrl)
+ })
const download = IS_WINDOWS
? octokit.rest.repos.downloadZipballArchive
: octokit.rest.repos.downloadTarballArchive