adds signoff option to sign off commits

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>
This commit is contained in:
pvogt09 2020-07-30 15:51:23 +02:00
parent a81d0faef6
commit ddd52205b6
5 changed files with 16 additions and 4 deletions

View file

@ -77,7 +77,8 @@ export async function createOrUpdateBranch(
commitMessage: string,
base: string,
branch: string,
branchRemoteName: string
branchRemoteName: string,
signoff: boolean
): Promise<CreateOrUpdateBranchResult> {
// Get the working base. This may or may not be the actual base.
const workingBase = await git.symbolicRef('HEAD', ['--short'])
@ -99,7 +100,11 @@ export async function createOrUpdateBranch(
if (await git.isDirty(true)) {
core.info('Uncommitted changes found. Adding a commit.')
await git.exec(['add', '-A'])
await git.commit(['-m', commitMessage])
if (signoff == true) {
await git.commit(['--signoff', '-m', commitMessage])
} else {
await git.commit(['-m', commitMessage])
}
}
// Perform fetch and reset the working base