upgrade module to esm and update dependencies (#2463)

* upgrade module to esm so I can update dependencies

* fix ci failures
This commit is contained in:
Aiqiao Yan
2026-06-16 17:10:58 -04:00
committed by GitHub
parent 537c7ef99c
commit d914b262ff
57 changed files with 29272 additions and 24100 deletions
+5 -5
View File
@@ -5,12 +5,12 @@ import * as fs from 'fs'
import * as io from '@actions/io'
import * as os from 'os'
import * as path from 'path'
import * as regexpHelper from './regexp-helper'
import * as stateHelper from './state-helper'
import * as urlHelper from './url-helper'
import * as regexpHelper from './regexp-helper.js'
import * as stateHelper from './state-helper.js'
import * as urlHelper from './url-helper.js'
import {randomUUID} from 'crypto'
import {IGitCommandManager} from './git-command-manager'
import {IGitSourceSettings} from './git-source-settings'
import {IGitCommandManager} from './git-command-manager.js'
import {IGitSourceSettings} from './git-source-settings.js'
const IS_WINDOWS = process.platform === 'win32'
const SSH_COMMAND_KEY = 'core.sshCommand'
+5 -5
View File
@@ -1,13 +1,13 @@
import * as core from '@actions/core'
import * as exec from '@actions/exec'
import * as fs from 'fs'
import * as fshelper from './fs-helper'
import * as fshelper from './fs-helper.js'
import * as io from '@actions/io'
import * as path from 'path'
import * as refHelper from './ref-helper'
import * as regexpHelper from './regexp-helper'
import * as retryHelper from './retry-helper'
import {GitVersion} from './git-version'
import * as refHelper from './ref-helper.js'
import * as regexpHelper from './regexp-helper.js'
import * as retryHelper from './retry-helper.js'
import {GitVersion} from './git-version.js'
// Auth header not supported before 2.9
// Wire protocol v2 not supported before 2.18
+2 -2
View File
@@ -1,10 +1,10 @@
import * as assert from 'assert'
import * as core from '@actions/core'
import * as fs from 'fs'
import * as fsHelper from './fs-helper'
import * as fsHelper from './fs-helper.js'
import * as io from '@actions/io'
import * as path from 'path'
import {IGitCommandManager} from './git-command-manager'
import {IGitCommandManager} from './git-command-manager.js'
export async function prepareExistingDirectory(
git: IGitCommandManager | undefined,
+10 -10
View File
@@ -1,19 +1,19 @@
import * as core from '@actions/core'
import * as fsHelper from './fs-helper'
import * as gitAuthHelper from './git-auth-helper'
import * as gitCommandManager from './git-command-manager'
import * as gitDirectoryHelper from './git-directory-helper'
import * as githubApiHelper from './github-api-helper'
import * as fsHelper from './fs-helper.js'
import * as gitAuthHelper from './git-auth-helper.js'
import * as gitCommandManager from './git-command-manager.js'
import * as gitDirectoryHelper from './git-directory-helper.js'
import * as githubApiHelper from './github-api-helper.js'
import * as io from '@actions/io'
import * as path from 'path'
import * as refHelper from './ref-helper'
import * as stateHelper from './state-helper'
import * as urlHelper from './url-helper'
import * as refHelper from './ref-helper.js'
import * as stateHelper from './state-helper.js'
import * as urlHelper from './url-helper.js'
import {
MinimumGitSparseCheckoutVersion,
IGitCommandManager
} from './git-command-manager'
import {IGitSourceSettings} from './git-source-settings'
} from './git-command-manager.js'
import {IGitSourceSettings} from './git-source-settings.js'
export async function getSource(settings: IGitSourceSettings): Promise<void> {
// Repository URL
+2 -2
View File
@@ -4,10 +4,10 @@ import * as fs from 'fs'
import * as github from '@actions/github'
import * as io from '@actions/io'
import * as path from 'path'
import * as retryHelper from './retry-helper'
import * as retryHelper from './retry-helper.js'
import * as toolCache from '@actions/tool-cache'
import {randomUUID} from 'crypto'
import {getServerApiUrl} from './url-helper'
import {getServerApiUrl} from './url-helper.js'
const IS_WINDOWS = process.platform === 'win32'
+4 -4
View File
@@ -1,10 +1,10 @@
import * as core from '@actions/core'
import * as fsHelper from './fs-helper'
import * as fsHelper from './fs-helper.js'
import * as github from '@actions/github'
import * as path from 'path'
import * as unsafePrCheckoutHelper from './unsafe-pr-checkout-helper'
import * as workflowContextHelper from './workflow-context-helper'
import {IGitSourceSettings} from './git-source-settings'
import * as unsafePrCheckoutHelper from './unsafe-pr-checkout-helper.js'
import * as workflowContextHelper from './workflow-context-helper.js'
import {IGitSourceSettings} from './git-source-settings.js'
export async function getInputs(): Promise<IGitSourceSettings> {
const result = {} as unknown as IGitSourceSettings
+9 -9
View File
@@ -1,9 +1,11 @@
import * as core from '@actions/core'
import * as coreCommand from '@actions/core/lib/command'
import * as gitSourceProvider from './git-source-provider'
import * as inputHelper from './input-helper'
import * as gitSourceProvider from './git-source-provider.js'
import * as inputHelper from './input-helper.js'
import * as path from 'path'
import * as stateHelper from './state-helper'
import * as stateHelper from './state-helper.js'
import {fileURLToPath} from 'url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
async function run(): Promise<void> {
try {
@@ -11,10 +13,8 @@ async function run(): Promise<void> {
try {
// Register problem matcher
coreCommand.issueCommand(
'add-matcher',
{},
path.join(__dirname, 'problem-matcher.json')
core.info(
`::add-matcher::${path.join(__dirname, 'problem-matcher.json')}`
)
// Get sources
@@ -22,7 +22,7 @@ async function run(): Promise<void> {
core.setOutput('ref', sourceSettings.ref)
} finally {
// Unregister problem matcher
coreCommand.issueCommand('remove-matcher', {owner: 'checkout-git'}, '')
core.info('::remove-matcher owner=checkout-git::')
}
} catch (error) {
core.setFailed(`${(error as any)?.message ?? error}`)
+3
View File
@@ -2,6 +2,9 @@ import * as fs from 'fs'
import * as os from 'os'
import * as path from 'path'
import * as yaml from 'js-yaml'
import {fileURLToPath} from 'url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
//
// SUMMARY
+2 -2
View File
@@ -1,7 +1,7 @@
import {IGitCommandManager} from './git-command-manager'
import {IGitCommandManager} from './git-command-manager.js'
import * as core from '@actions/core'
import * as github from '@actions/github'
import {getServerApiUrl, isGhes} from './url-helper'
import {getServerApiUrl, isGhes} from './url-helper.js'
export const tagsRefSpec = '+refs/tags/*:refs/tags/*'
+1 -1
View File
@@ -1,5 +1,5 @@
import * as github from '@actions/github'
import {fromPayload} from './ref-helper'
import {fromPayload} from './ref-helper.js'
const PR_REF_PATTERN = /^refs\/pull\/[0-9]+\/(?:head|merge)$/
+1 -1
View File
@@ -1,6 +1,6 @@
import * as assert from 'assert'
import {URL} from 'url'
import {IGitSourceSettings} from './git-source-settings'
import {IGitSourceSettings} from './git-source-settings.js'
export function getFetchUrl(settings: IGitSourceSettings): string {
assert.ok(