Skip to content

Commit 42409b7

Browse files
committed
upgrade to v3.5.2: merge branch 'main' from actions/checkout into coldfusionjp/main
* main: Release v3.5.2 (actions#1291) Fix: convert baseUrl to serverApiUrl 'formatted' (actions#1289)
1 parent 3025d72 commit 42409b7

File tree

6 files changed

+23
-10
lines changed

6 files changed

+23
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## v3.5.2
4+
- [Fix api endpoint for GHES](https://github.com/actions/checkout/pull/1289)
5+
36
## v3.5.1
47
- [Fix slow checkout on Windows](https://github.com/actions/checkout/pull/1246)
58

dist/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,6 +1503,7 @@ const path = __importStar(__nccwpck_require__(1017));
15031503
const retryHelper = __importStar(__nccwpck_require__(2155));
15041504
const toolCache = __importStar(__nccwpck_require__(7784));
15051505
const v4_1 = __importDefault(__nccwpck_require__(824));
1506+
const url_helper_1 = __nccwpck_require__(9437);
15061507
const IS_WINDOWS = process.platform === 'win32';
15071508
function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
15081509
return __awaiter(this, void 0, void 0, function* () {
@@ -1563,7 +1564,9 @@ function getDefaultBranch(authToken, owner, repo, baseUrl) {
15631564
return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
15641565
var _a;
15651566
core.info('Retrieving the default branch name');
1566-
const octokit = github.getOctokit(authToken, { baseUrl: baseUrl });
1567+
const octokit = github.getOctokit(authToken, {
1568+
baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
1569+
});
15671570
let result;
15681571
try {
15691572
// Get the default branch from the repo info
@@ -1595,7 +1598,9 @@ function getDefaultBranch(authToken, owner, repo, baseUrl) {
15951598
exports.getDefaultBranch = getDefaultBranch;
15961599
function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
15971600
return __awaiter(this, void 0, void 0, function* () {
1598-
const octokit = github.getOctokit(authToken, { baseUrl: baseUrl });
1601+
const octokit = github.getOctokit(authToken, {
1602+
baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
1603+
});
15991604
const download = IS_WINDOWS
16001605
? octokit.rest.repos.downloadZipballArchive
16011606
: octokit.rest.repos.downloadTarballArchive;
@@ -2081,7 +2086,7 @@ function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref
20812086
if (actualHeadSha !== expectedHeadSha) {
20822087
core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
20832088
const octokit = github.getOctokit(token, {
2084-
baseUrl: baseUrl,
2089+
baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
20852090
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})`
20862091
});
20872092
yield octokit.rest.repos.get({

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "checkout-plus",
3-
"version": "3.5.1",
3+
"version": "3.5.2",
44
"description": "Checkout Plus action",
55
"main": "lib/main.js",
66
"scripts": {

src/github-api-helper.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as path from 'path'
77
import * as retryHelper from './retry-helper'
88
import * as toolCache from '@actions/tool-cache'
99
import {default as uuid} from 'uuid/v4'
10+
import {getServerApiUrl} from './url-helper'
1011

1112
const IS_WINDOWS = process.platform === 'win32'
1213

@@ -84,7 +85,9 @@ export async function getDefaultBranch(
8485
): Promise<string> {
8586
return await retryHelper.execute(async () => {
8687
core.info('Retrieving the default branch name')
87-
const octokit = github.getOctokit(authToken, {baseUrl: baseUrl})
88+
const octokit = github.getOctokit(authToken, {
89+
baseUrl: getServerApiUrl(baseUrl)
90+
})
8891
let result: string
8992
try {
9093
// Get the default branch from the repo info
@@ -125,7 +128,9 @@ async function downloadArchive(
125128
commit: string,
126129
baseUrl?: string
127130
): Promise<Buffer> {
128-
const octokit = github.getOctokit(authToken, {baseUrl: baseUrl})
131+
const octokit = github.getOctokit(authToken, {
132+
baseUrl: getServerApiUrl(baseUrl)
133+
})
129134
const download = IS_WINDOWS
130135
? octokit.rest.repos.downloadZipballArchive
131136
: octokit.rest.repos.downloadTarballArchive

src/ref-helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {IGitCommandManager} from './git-command-manager'
22
import * as core from '@actions/core'
33
import * as github from '@actions/github'
4-
import {isGhes} from './url-helper'
4+
import {getServerApiUrl, isGhes} from './url-helper'
55

66
export const tagsRefSpec = '+refs/tags/*:refs/tags/*'
77

@@ -245,7 +245,7 @@ export async function checkCommitInfo(
245245
`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`
246246
)
247247
const octokit = github.getOctokit(token, {
248-
baseUrl: baseUrl,
248+
baseUrl: getServerApiUrl(baseUrl),
249249
userAgent: `actions-checkout-tracepoint/1.0 (code=STALE_MERGE;owner=${repositoryOwner};repo=${repositoryName};pr=${fromPayload(
250250
'number'
251251
)};run_id=${

0 commit comments

Comments
 (0)