From 6e020c8cc7b0df394197c68256fddb081d632d8f Mon Sep 17 00:00:00 2001 From: Tatyana Kostromskaya Date: Thu, 5 Oct 2023 13:10:00 +0200 Subject: . --- src/fs-helper.ts | 15 +++++++++------ src/git-auth-helper.ts | 2 +- src/input-helper.ts | 5 +++-- src/ref-helper.ts | 2 +- src/workflow-context-helper.ts | 5 +++-- 5 files changed, 17 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/fs-helper.ts b/src/fs-helper.ts index 3741d35..00ad941 100644 --- a/src/fs-helper.ts +++ b/src/fs-helper.ts @@ -18,8 +18,9 @@ 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 + }` ) } @@ -45,8 +46,9 @@ 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 + }` ) } @@ -67,8 +69,9 @@ 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 + }` ) } diff --git a/src/git-auth-helper.ts b/src/git-auth-helper.ts index 364a04e..6dc158f 100644 --- a/src/git-auth-helper.ts +++ b/src/git-auth-helper.ts @@ -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) diff --git a/src/input-helper.ts b/src/input-helper.ts index e546c19..1a35aa4 100644 --- a/src/input-helper.ts +++ b/src/input-helper.ts @@ -6,7 +6,7 @@ import * as workflowContextHelper from './workflow-context-helper' import {IGitSourceSettings} from './git-source-settings' export async function getInputs(): Promise { - const result = ({} as unknown) as IGitSourceSettings + const result = {} as unknown as IGitSourceSettings // GitHub workspace let githubWorkspacePath = process.env['GITHUB_WORKSPACE'] @@ -149,7 +149,8 @@ export async function getInputs(): Promise { (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 = diff --git a/src/ref-helper.ts b/src/ref-helper.ts index 1c25049..047e906 100644 --- a/src/ref-helper.ts +++ b/src/ref-helper.ts @@ -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 diff --git a/src/workflow-context-helper.ts b/src/workflow-context-helper.ts index c7d7918..5b342e6 100644 --- a/src/workflow-context-helper.ts +++ b/src/workflow-context-helper.ts @@ -23,8 +23,9 @@ export async function getOrganizationId(): Promise { 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 + }` ) } } -- cgit v1.2.3