mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Update git.ts
This commit is contained in:
parent
bb859665e0
commit
b22f2e67d3
17
src/git.ts
17
src/git.ts
@ -31,15 +31,12 @@ export async function init(action: ActionInterface): Promise<void | Error> {
|
||||
attempt++
|
||||
|
||||
if (attempt > ATTEMPT_LIMIT) {
|
||||
throw new Error();
|
||||
throw new Error()
|
||||
}
|
||||
|
||||
if (attempt > 1) {
|
||||
await execute(
|
||||
`git init`,
|
||||
action.workspace,
|
||||
action.silent
|
||||
)
|
||||
// Handles the 'fatal: not a git directory' error.
|
||||
await execute(`git init`, action.workspace, action.silent)
|
||||
|
||||
await execute(
|
||||
`git commit -m "Initial commit" --allow-empty`,
|
||||
@ -59,20 +56,20 @@ export async function init(action: ActionInterface): Promise<void | Error> {
|
||||
action.workspace,
|
||||
action.silent
|
||||
)
|
||||
|
||||
|
||||
await execute(
|
||||
`git config user.email "${action.email}"`,
|
||||
action.workspace,
|
||||
action.silent
|
||||
)
|
||||
|
||||
|
||||
await execute(
|
||||
`git config core.ignorecase false`,
|
||||
action.workspace,
|
||||
action.silent
|
||||
)
|
||||
} while(rejected)
|
||||
|
||||
} while (rejected)
|
||||
|
||||
try {
|
||||
if ((process.env.CI && !action.sshKey) || action.isTest) {
|
||||
/* Ensures that previously set Git configs do not interfere with the deployment.
|
||||
|
Loading…
Reference in New Issue
Block a user