mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-26 22:09:55 +02:00
Fix: convert baseUrl to serverApiUrl 'formatted' (#1289)
* fix: convert baseUrl to apiUrl * Run prettier --------- Co-authored-by: 1newsr <1newsr@users.noreply.github.com>
This commit is contained in:
parent
83b7061638
commit
eb35239ec2
3 changed files with 17 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue