mirror of
https://github.com/actions/checkout.git
synced 2025-03-31 05:20:06 +02:00
Fix linting and formatting issues
This commit is contained in:
parent
dc3f9aa6d6
commit
287da9b78e
3 changed files with 20 additions and 7 deletions
|
@ -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
|
||||||
|
|
|
@ -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')
|
||||||
}
|
}
|
||||||
|
|
|
@ -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}`
|
||||||
|
|
Loading…
Add table
Reference in a new issue