feat: add input to enable gpg commit signing

This commit is contained in:
Peter Evans 2021-05-09 10:14:55 +09:00
parent 548adff9dc
commit 0524c01297
9 changed files with 8015 additions and 7 deletions

View file

@ -91,7 +91,8 @@ export async function createOrUpdateBranch(
base: string,
branch: string,
branchRemoteName: string,
signoff: boolean
signoff: boolean,
gpgSign: boolean
): Promise<CreateOrUpdateBranchResult> {
// Get the working base.
// When a ref, it may or may not be the actual base.
@ -124,6 +125,9 @@ export async function createOrUpdateBranch(
if (signoff) {
params.push('--signoff')
}
if (gpgSign) {
params.push('--gpg-sign')
}
await git.commit(params)
}

View file

@ -16,6 +16,7 @@ export interface Inputs {
committer: string
author: string
signoff: boolean
gpgSign: boolean
branch: string
deleteBranch: boolean
branchSuffix: string
@ -173,7 +174,8 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
inputs.base,
inputs.branch,
branchRemoteName,
inputs.signoff
inputs.signoff,
inputs.gpgSign
)
core.endGroup()

View file

@ -12,6 +12,7 @@ async function run(): Promise<void> {
committer: core.getInput('committer'),
author: core.getInput('author'),
signoff: core.getInput('signoff') === 'true',
gpgSign: core.getInput('gpg-sign') === 'true',
branch: core.getInput('branch'),
deleteBranch: core.getInput('delete-branch') === 'true',
branchSuffix: core.getInput('branch-suffix'),