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/ref-helper.ts
diff options
context:
space:
mode:
authorBinrui Dong <brett.browning.dong@gmail.com>2023-04-12 19:55:27 +0800
committerGitHub <noreply@github.com>2023-04-12 13:55:27 +0200
commit14d9c28776de95fa1aca6d4fa9c2095443729e7d (patch)
treecdbb5401fb8994cd3a57595464f622b6be9e21e0 /src/ref-helper.ts
parent9aef52d510de4e17a0ea5f69c5e81c687daf417c (diff)
Improve checkout performance on Windows runners by upgrading @actions/github dependency (#1246)
* Improve checkout performance on Windows runners by upgrading @actions/github dependency Re: https://github.com/actions/checkout/issues/1186 @dscho discovered that the checkout action could stall for a considerable amount of time on Windows runners waiting for PowerShell invocations made from 'windows-release' npm package to complete. Then I studied the dependency chain to figure out where 'windows-release' was imported: '@actions/checkout'@main <- '@actions/github'@2.2.0 <- '@octokit/endpoint'@6.0.1 <- '@octokit/graphql'@4.3.1 <- '@octokit/request'@5.4.2 <- '@octokit/rest'@16.43.1 <- 'universal-user-agent'@4.0.1 <- 'os-name'@3.1.0 <- 'windows-release'@3.1.0 'universal-user-agent' package dropped its dependency on 'os-name' in https://github.com/gr2m/universal-user-agent/releases/tag/v6.0.0 . '@actions/github' v3 removed dependency on '@octokit/rest'@16.43.1 and allows users to move away from the old 'universal-user-agent' v4. (https://github.com/actions/toolkit/pull/453) This pull request attempts to update the version of '@actions/github' used in the checkout action to avoid importing 'windows-release'. Based on testing in my own repositories, I can see an improvement in reduced wait time between entering the checkout action and git actually starts to do useful work. * Update .licenses * Rebuild index.js
Diffstat (limited to 'src/ref-helper.ts')
-rw-r--r--src/ref-helper.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ref-helper.ts b/src/ref-helper.ts
index ce875fc..9b1ca95 100644
--- a/src/ref-helper.ts
+++ b/src/ref-helper.ts
@@ -1,7 +1,6 @@
import {IGitCommandManager} from './git-command-manager'
import * as core from '@actions/core'
import * as github from '@actions/github'
-import {getOctokit} from './octokit-provider'
import {isGhes} from './url-helper'
export const tagsRefSpec = '+refs/tags/*:refs/tags/*'
@@ -245,7 +244,7 @@ export async function checkCommitInfo(
core.debug(
`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`
)
- const octokit = getOctokit(token, {
+ const octokit = github.getOctokit(token, {
baseUrl: baseUrl,
userAgent: `actions-checkout-tracepoint/1.0 (code=STALE_MERGE;owner=${repositoryOwner};repo=${repositoryName};pr=${fromPayload(
'number'
@@ -253,7 +252,10 @@ export async function checkCommitInfo(
process.env['GITHUB_RUN_ID']
};expected_head_sha=${expectedHeadSha};actual_head_sha=${actualHeadSha})`
})
- await octokit.repos.get({owner: repositoryOwner, repo: repositoryName})
+ await octokit.rest.repos.get({
+ owner: repositoryOwner,
+ repo: repositoryName
+ })
}
} catch (err) {
core.debug(