3
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2025-04-24 04:15:33 +00:00

Run format, lint and build

Signed-off-by: Luca Comellini <luca.com@gmail.com>
This commit is contained in:
Luca Comellini 2024-05-07 11:25:35 -07:00
parent 44c2b7a8a4
commit b260373e81
No known key found for this signature in database
GPG key ID: 4850B36E838507C6
9 changed files with 9720 additions and 29471 deletions

View file

@ -18,9 +18,8 @@ export function directoryExistsSync(path: string, required?: boolean): boolean {
}
throw new Error(
`Encountered an error when checking whether path '${path}' exists: ${
(error as any)?.message ?? error
}`
`Encountered an error when checking whether path '${path}' exists: ${(error as any)
?.message ?? error}`
)
}
@ -46,9 +45,8 @@ export function existsSync(path: string): boolean {
}
throw new Error(
`Encountered an error when checking whether path '${path}' exists: ${
(error as any)?.message ?? error
}`
`Encountered an error when checking whether path '${path}' exists: ${(error as any)
?.message ?? error}`
)
}
@ -69,9 +67,8 @@ export function fileExistsSync(path: string): boolean {
}
throw new Error(
`Encountered an error when checking whether path '${path}' exists: ${
(error as any)?.message ?? error
}`
`Encountered an error when checking whether path '${path}' exists: ${(error as any)
?.message ?? error}`
)
}

View file

@ -49,7 +49,7 @@ class GitAuthHelper {
gitSourceSettings: IGitSourceSettings | undefined
) {
this.git = gitCommandManager
this.settings = gitSourceSettings || ({} as unknown as IGitSourceSettings)
this.settings = gitSourceSettings || (({} as unknown) as IGitSourceSettings)
// Token auth header
const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl)

View file

@ -6,7 +6,7 @@ import * as workflowContextHelper from './workflow-context-helper'
import {IGitSourceSettings} from './git-source-settings'
export async function getInputs(): Promise<IGitSourceSettings> {
const result = {} as unknown as IGitSourceSettings
const result = ({} as unknown) as IGitSourceSettings
// GitHub workspace
let githubWorkspacePath = process.env['GITHUB_WORKSPACE']
@ -150,8 +150,7 @@ export async function getInputs(): Promise<IGitSourceSettings> {
(core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE'
// Workflow organization ID
result.workflowOrganizationId =
await workflowContextHelper.getOrganizationId()
result.workflowOrganizationId = await workflowContextHelper.getOrganizationId()
// Set safe.directory in git global config.
result.setSafeDirectory =

View file

@ -23,7 +23,7 @@ export async function getCheckoutInfo(
throw new Error('Args ref and commit cannot both be empty')
}
const result = {} as unknown as ICheckoutInfo
const result = ({} as unknown) as ICheckoutInfo
const upperRef = (ref || '').toUpperCase()
// SHA only

View file

@ -23,9 +23,8 @@ export async function getOrganizationId(): Promise<number | undefined> {
return id as number
} catch (err) {
core.debug(
`Unable to load organization ID from GITHUB_EVENT_PATH: ${
(err as any).message || err
}`
`Unable to load organization ID from GITHUB_EVENT_PATH: ${(err as any)
.message || err}`
)
}
}