Refactor setting commit params

This commit is contained in:
Peter Evans 2020-07-31 16:57:16 +09:00
parent ee482f51bd
commit ba8309ff9c
2 changed files with 10 additions and 11 deletions

View file

@ -100,11 +100,11 @@ export async function createOrUpdateBranch(
if (await git.isDirty(true)) {
core.info('Uncommitted changes found. Adding a commit.')
await git.exec(['add', '-A'])
if (signoff == true) {
await git.commit(['-m', commitMessage, '-s'])
} else {
await git.commit(['-m', commitMessage])
const params = ['-m', commitMessage]
if (signoff) {
params.push('--signoff')
}
await git.commit(params)
}
// Perform fetch and reset the working base