diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/git-auth-helper.ts | 10 | ||||
| -rw-r--r-- | src/git-command-manager.ts | 10 | ||||
| -rw-r--r-- | src/git-directory-helper.ts | 4 | ||||
| -rw-r--r-- | src/git-source-provider.ts | 20 | ||||
| -rw-r--r-- | src/github-api-helper.ts | 4 | ||||
| -rw-r--r-- | src/input-helper.ts | 8 | ||||
| -rw-r--r-- | src/main.ts | 18 | ||||
| -rw-r--r-- | src/misc/generate-docs.ts | 3 | ||||
| -rw-r--r-- | src/ref-helper.ts | 4 | ||||
| -rw-r--r-- | src/unsafe-pr-checkout-helper.ts | 2 | ||||
| -rw-r--r-- | src/url-helper.ts | 2 |
11 files changed, 44 insertions, 41 deletions
diff --git a/src/git-auth-helper.ts b/src/git-auth-helper.ts index 1798b10..dd7e6fb 100644 --- a/src/git-auth-helper.ts +++ b/src/git-auth-helper.ts @@ -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' diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index f1349ce..36cdb47 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -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 diff --git a/src/git-directory-helper.ts b/src/git-directory-helper.ts index 9a0085f..c73a1a4 100644 --- a/src/git-directory-helper.ts +++ b/src/git-directory-helper.ts @@ -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, diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index 452d44e..b9c1d35 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -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 diff --git a/src/github-api-helper.ts b/src/github-api-helper.ts index db42d37..61d7459 100644 --- a/src/github-api-helper.ts +++ b/src/github-api-helper.ts @@ -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' diff --git a/src/input-helper.ts b/src/input-helper.ts index 2d20930..ce71cb3 100644 --- a/src/input-helper.ts +++ b/src/input-helper.ts @@ -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 diff --git a/src/main.ts b/src/main.ts index 0684c6f..f5f5f68 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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}`) diff --git a/src/misc/generate-docs.ts b/src/misc/generate-docs.ts index b78f035..ada3acd 100644 --- a/src/misc/generate-docs.ts +++ b/src/misc/generate-docs.ts @@ -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 diff --git a/src/ref-helper.ts b/src/ref-helper.ts index 8751712..b0da285 100644 --- a/src/ref-helper.ts +++ b/src/ref-helper.ts @@ -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/*' diff --git a/src/unsafe-pr-checkout-helper.ts b/src/unsafe-pr-checkout-helper.ts index efc0ef6..899ad1e 100644 --- a/src/unsafe-pr-checkout-helper.ts +++ b/src/unsafe-pr-checkout-helper.ts @@ -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)$/ diff --git a/src/url-helper.ts b/src/url-helper.ts index 17a0842..3dca6e9 100644 --- a/src/url-helper.ts +++ b/src/url-helper.ts @@ -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( |
