mirror of
				https://github.com/actions/checkout.git
				synced 2025-11-04 15:58:09 +08:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
			fhammerl/r
			...
			v3.5.2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					8e5e7e5ab8 | ||
| 
						 | 
					eb35239ec2 | ||
| 
						 | 
					83b7061638 | 
@@ -1,5 +1,14 @@
 | 
				
			|||||||
# Changelog
 | 
					# Changelog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## v3.5.2
 | 
				
			||||||
 | 
					- [Fix api endpoint for GHES](https://github.com/actions/checkout/pull/1289)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## v3.5.1
 | 
				
			||||||
 | 
					- [Fix slow checkout on Windows](https://github.com/actions/checkout/pull/1246)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## v3.5.0
 | 
				
			||||||
 | 
					* [Add new public key for known_hosts](https://github.com/actions/checkout/pull/1237)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## v3.4.0
 | 
					## v3.4.0
 | 
				
			||||||
- [Upgrade codeql actions to v2](https://github.com/actions/checkout/pull/1209)
 | 
					- [Upgrade codeql actions to v2](https://github.com/actions/checkout/pull/1209)
 | 
				
			||||||
- [Upgrade dependencies](https://github.com/actions/checkout/pull/1210)
 | 
					- [Upgrade dependencies](https://github.com/actions/checkout/pull/1210)
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										11
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							@@ -1453,6 +1453,7 @@ const path = __importStar(__nccwpck_require__(1017));
 | 
				
			|||||||
const retryHelper = __importStar(__nccwpck_require__(2155));
 | 
					const retryHelper = __importStar(__nccwpck_require__(2155));
 | 
				
			||||||
const toolCache = __importStar(__nccwpck_require__(7784));
 | 
					const toolCache = __importStar(__nccwpck_require__(7784));
 | 
				
			||||||
const v4_1 = __importDefault(__nccwpck_require__(824));
 | 
					const v4_1 = __importDefault(__nccwpck_require__(824));
 | 
				
			||||||
 | 
					const url_helper_1 = __nccwpck_require__(9437);
 | 
				
			||||||
const IS_WINDOWS = process.platform === 'win32';
 | 
					const IS_WINDOWS = process.platform === 'win32';
 | 
				
			||||||
function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
 | 
					function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
@@ -1513,7 +1514,9 @@ function getDefaultBranch(authToken, owner, repo, baseUrl) {
 | 
				
			|||||||
        return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
 | 
					        return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
            var _a;
 | 
					            var _a;
 | 
				
			||||||
            core.info('Retrieving the default branch name');
 | 
					            core.info('Retrieving the default branch name');
 | 
				
			||||||
            const octokit = github.getOctokit(authToken, { baseUrl: baseUrl });
 | 
					            const octokit = github.getOctokit(authToken, {
 | 
				
			||||||
 | 
					                baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
            let result;
 | 
					            let result;
 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
                // Get the default branch from the repo info
 | 
					                // Get the default branch from the repo info
 | 
				
			||||||
@@ -1545,7 +1548,9 @@ function getDefaultBranch(authToken, owner, repo, baseUrl) {
 | 
				
			|||||||
exports.getDefaultBranch = getDefaultBranch;
 | 
					exports.getDefaultBranch = getDefaultBranch;
 | 
				
			||||||
function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
 | 
					function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        const octokit = github.getOctokit(authToken, { baseUrl: baseUrl });
 | 
					        const octokit = github.getOctokit(authToken, {
 | 
				
			||||||
 | 
					            baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
        const download = IS_WINDOWS
 | 
					        const download = IS_WINDOWS
 | 
				
			||||||
            ? octokit.rest.repos.downloadZipballArchive
 | 
					            ? octokit.rest.repos.downloadZipballArchive
 | 
				
			||||||
            : octokit.rest.repos.downloadTarballArchive;
 | 
					            : octokit.rest.repos.downloadTarballArchive;
 | 
				
			||||||
@@ -2026,7 +2031,7 @@ function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref
 | 
				
			|||||||
            if (actualHeadSha !== expectedHeadSha) {
 | 
					            if (actualHeadSha !== expectedHeadSha) {
 | 
				
			||||||
                core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
 | 
					                core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
 | 
				
			||||||
                const octokit = github.getOctokit(token, {
 | 
					                const octokit = github.getOctokit(token, {
 | 
				
			||||||
                    baseUrl: baseUrl,
 | 
					                    baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
 | 
				
			||||||
                    userAgent: `actions-checkout-tracepoint/1.0 (code=STALE_MERGE;owner=${repositoryOwner};repo=${repositoryName};pr=${fromPayload('number')};run_id=${process.env['GITHUB_RUN_ID']};expected_head_sha=${expectedHeadSha};actual_head_sha=${actualHeadSha})`
 | 
					                    userAgent: `actions-checkout-tracepoint/1.0 (code=STALE_MERGE;owner=${repositoryOwner};repo=${repositoryName};pr=${fromPayload('number')};run_id=${process.env['GITHUB_RUN_ID']};expected_head_sha=${expectedHeadSha};actual_head_sha=${actualHeadSha})`
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
                yield octokit.rest.repos.get({
 | 
					                yield octokit.rest.repos.get({
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -1,12 +1,12 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "checkout",
 | 
					  "name": "checkout",
 | 
				
			||||||
  "version": "3.6.0",
 | 
					  "version": "3.5.2",
 | 
				
			||||||
  "lockfileVersion": 2,
 | 
					  "lockfileVersion": 2,
 | 
				
			||||||
  "requires": true,
 | 
					  "requires": true,
 | 
				
			||||||
  "packages": {
 | 
					  "packages": {
 | 
				
			||||||
    "": {
 | 
					    "": {
 | 
				
			||||||
      "name": "checkout",
 | 
					      "name": "checkout",
 | 
				
			||||||
      "version": "3.6.0",
 | 
					      "version": "3.5.2",
 | 
				
			||||||
      "license": "MIT",
 | 
					      "license": "MIT",
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "@actions/core": "^1.10.0",
 | 
					        "@actions/core": "^1.10.0",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "checkout",
 | 
					  "name": "checkout",
 | 
				
			||||||
  "version": "3.6.0",
 | 
					  "version": "3.5.2",
 | 
				
			||||||
  "description": "checkout action",
 | 
					  "description": "checkout action",
 | 
				
			||||||
  "main": "lib/main.js",
 | 
					  "main": "lib/main.js",
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,7 @@ import * as path from 'path'
 | 
				
			|||||||
import * as retryHelper from './retry-helper'
 | 
					import * as retryHelper from './retry-helper'
 | 
				
			||||||
import * as toolCache from '@actions/tool-cache'
 | 
					import * as toolCache from '@actions/tool-cache'
 | 
				
			||||||
import {default as uuid} from 'uuid/v4'
 | 
					import {default as uuid} from 'uuid/v4'
 | 
				
			||||||
 | 
					import {getServerApiUrl} from './url-helper'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const IS_WINDOWS = process.platform === 'win32'
 | 
					const IS_WINDOWS = process.platform === 'win32'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -84,7 +85,9 @@ export async function getDefaultBranch(
 | 
				
			|||||||
): Promise<string> {
 | 
					): Promise<string> {
 | 
				
			||||||
  return await retryHelper.execute(async () => {
 | 
					  return await retryHelper.execute(async () => {
 | 
				
			||||||
    core.info('Retrieving the default branch name')
 | 
					    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
 | 
					    let result: string
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
      // Get the default branch from the repo info
 | 
					      // Get the default branch from the repo info
 | 
				
			||||||
@@ -125,7 +128,9 @@ async function downloadArchive(
 | 
				
			|||||||
  commit: string,
 | 
					  commit: string,
 | 
				
			||||||
  baseUrl?: string
 | 
					  baseUrl?: string
 | 
				
			||||||
): Promise<Buffer> {
 | 
					): Promise<Buffer> {
 | 
				
			||||||
  const octokit = github.getOctokit(authToken, {baseUrl: baseUrl})
 | 
					  const octokit = github.getOctokit(authToken, {
 | 
				
			||||||
 | 
					    baseUrl: getServerApiUrl(baseUrl)
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
  const download = IS_WINDOWS
 | 
					  const download = IS_WINDOWS
 | 
				
			||||||
    ? octokit.rest.repos.downloadZipballArchive
 | 
					    ? octokit.rest.repos.downloadZipballArchive
 | 
				
			||||||
    : octokit.rest.repos.downloadTarballArchive
 | 
					    : octokit.rest.repos.downloadTarballArchive
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
import {IGitCommandManager} from './git-command-manager'
 | 
					import {IGitCommandManager} from './git-command-manager'
 | 
				
			||||||
import * as core from '@actions/core'
 | 
					import * as core from '@actions/core'
 | 
				
			||||||
import * as github from '@actions/github'
 | 
					import * as github from '@actions/github'
 | 
				
			||||||
import {isGhes} from './url-helper'
 | 
					import {getServerApiUrl, isGhes} from './url-helper'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const tagsRefSpec = '+refs/tags/*:refs/tags/*'
 | 
					export const tagsRefSpec = '+refs/tags/*:refs/tags/*'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -245,7 +245,7 @@ export async function checkCommitInfo(
 | 
				
			|||||||
        `Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`
 | 
					        `Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
      const octokit = github.getOctokit(token, {
 | 
					      const octokit = github.getOctokit(token, {
 | 
				
			||||||
        baseUrl: baseUrl,
 | 
					        baseUrl: getServerApiUrl(baseUrl),
 | 
				
			||||||
        userAgent: `actions-checkout-tracepoint/1.0 (code=STALE_MERGE;owner=${repositoryOwner};repo=${repositoryName};pr=${fromPayload(
 | 
					        userAgent: `actions-checkout-tracepoint/1.0 (code=STALE_MERGE;owner=${repositoryOwner};repo=${repositoryName};pr=${fromPayload(
 | 
				
			||||||
          'number'
 | 
					          'number'
 | 
				
			||||||
        )};run_id=${
 | 
					        )};run_id=${
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user