1
0
Fork 0
mirror of https://github.com/actions/checkout.git synced 2025-04-01 22:10:06 +02:00

Fix linting and formatting issues

This commit is contained in:
Milad Irannejad 2023-03-01 17:50:51 -05:00
parent dc3f9aa6d6
commit 287da9b78e
No known key found for this signature in database
GPG key ID: 83D922682700B3AC
3 changed files with 20 additions and 7 deletions

View file

@ -136,7 +136,12 @@ class GitAuthHelper {
await this.git.tryConfigUnset(this.insteadOfKey, ConfigScope.System) await this.git.tryConfigUnset(this.insteadOfKey, ConfigScope.System)
if (!this.settings.sshKey) { if (!this.settings.sshKey) {
for (const insteadOfValue of this.insteadOfValues) { for (const insteadOfValue of this.insteadOfValues) {
await this.git.config(this.insteadOfKey, insteadOfValue, ConfigScope.System, true) await this.git.config(
this.insteadOfKey,
insteadOfValue,
ConfigScope.System,
true
)
} }
} }
} catch (err) { } catch (err) {
@ -294,7 +299,7 @@ class GitAuthHelper {
await this.git.config( await this.git.config(
this.tokenConfigKey, this.tokenConfigKey,
this.tokenPlaceholderConfigValue, this.tokenPlaceholderConfigValue,
configScope, configScope
) )
// Replace the placeholder // Replace the placeholder

View file

@ -13,9 +13,9 @@ import {GitVersion} from './git-version'
export const MinimumGitVersion = new GitVersion('2.18') export const MinimumGitVersion = new GitVersion('2.18')
export enum ConfigScope { export enum ConfigScope {
Local = "local", Local = 'local',
Global = "global", Global = 'global',
System = "system", System = 'system'
} }
export interface IGitCommandManager { export interface IGitCommandManager {
@ -181,7 +181,10 @@ class GitCommandManager {
configScope?: ConfigScope, configScope?: ConfigScope,
add?: boolean add?: boolean
): Promise<void> { ): Promise<void> {
const args: string[] = ['config', configScope ? `--${configScope}` : '--local'] const args: string[] = [
'config',
configScope ? `--${configScope}` : '--local'
]
if (add) { if (add) {
args.push('--add') args.push('--add')
} }

View file

@ -50,7 +50,12 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
) )
await git await git
.config('safe.directory', settings.repositoryPath, ConfigScope.System, true) .config(
'safe.directory',
settings.repositoryPath,
ConfigScope.System,
true
)
.catch(error => { .catch(error => {
core.info( core.info(
`Failed to initialize safe directory with error: ${error}` `Failed to initialize safe directory with error: ${error}`