Skip to content

Commit

Permalink
判断是否有旧的发布
Browse files Browse the repository at this point in the history
  • Loading branch information
suziwen committed Dec 11, 2021
1 parent 401b8dc commit 855ffbb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ async function run(): Promise<void> {
console.log(`Deploying to repo: ${repo} and branch: ${deployBranch}`)
console.log('You can configure the deploy branch by setting the `deploy-branch` input for this action.')

await exec.exec(`git init`, [], {cwd: `${workingDir}/public`})
const exists = await ioUtil.exists(`${workingDir}/public/.git/config`)
if (!exists) {
await exec.exec(`git init`, [], {cwd: `${workingDir}/public`})
}

const gitUserName = core.getInput('git-config-name') || github.context.actor
const gitEmail = core.getInput('git-config-email') || `${github.context.actor}@users.noreply.github.com`
Expand Down

0 comments on commit 855ffbb

Please sign in to comment.