consume new @actions/github for GHES support (#236)
This commit is contained in:
		@@ -6,9 +6,8 @@ import * as io from '@actions/io'
 | 
			
		||||
import * as path from 'path'
 | 
			
		||||
import * as retryHelper from './retry-helper'
 | 
			
		||||
import * as toolCache from '@actions/tool-cache'
 | 
			
		||||
import * as urlHelper from './url-helper'
 | 
			
		||||
import {default as uuid} from 'uuid/v4'
 | 
			
		||||
import {ReposGetArchiveLinkParams} from '@octokit/rest'
 | 
			
		||||
import {Octokit} from '@octokit/rest'
 | 
			
		||||
 | 
			
		||||
const IS_WINDOWS = process.platform === 'win32'
 | 
			
		||||
 | 
			
		||||
@@ -75,8 +74,8 @@ async function downloadArchive(
 | 
			
		||||
  ref: string,
 | 
			
		||||
  commit: string
 | 
			
		||||
): Promise<Buffer> {
 | 
			
		||||
  const octokit = new github.GitHub(authToken, {baseUrl: urlHelper.getApiUrl()})
 | 
			
		||||
  const params: ReposGetArchiveLinkParams = {
 | 
			
		||||
  const octokit = new github.GitHub(authToken)
 | 
			
		||||
  const params: Octokit.ReposGetArchiveLinkParams = {
 | 
			
		||||
    owner: owner,
 | 
			
		||||
    repo: repo,
 | 
			
		||||
    archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
 | 
			
		||||
 
 | 
			
		||||
@@ -2,10 +2,6 @@ import * as assert from 'assert'
 | 
			
		||||
import {IGitSourceSettings} from './git-source-settings'
 | 
			
		||||
import {URL} from 'url'
 | 
			
		||||
 | 
			
		||||
export function getApiUrl(): string {
 | 
			
		||||
  return process.env['GITHUB_API_URL'] || 'https://api.github.com'
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getFetchUrl(settings: IGitSourceSettings): string {
 | 
			
		||||
  assert.ok(
 | 
			
		||||
    settings.repositoryOwner,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user