diff --git a/action.yml b/action.yml index c169c32..0381724 100644 --- a/action.yml +++ b/action.yml @@ -24,6 +24,9 @@ inputs: signoff: description: 'Add `Signed-off-by` line by the committer at the end of the commit log message.' default: false + gpg-sign: + description: 'GPG-sign commits.' + default: false branch: description: 'The pull request branch name.' default: 'create-pull-request/patch' diff --git a/dist/index.js b/dist/index.js index b1d6be6..8842ea4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -99,7 +99,7 @@ function splitLines(multilineString) { .map(s => s.trim()) .filter(x => x !== ''); } -function createOrUpdateBranch(git, commitMessage, base, branch, branchRemoteName, signoff) { +function createOrUpdateBranch(git, commitMessage, base, branch, branchRemoteName, signoff, gpgSign) { return __awaiter(this, void 0, void 0, function* () { // Get the working base. // When a ref, it may or may not be the actual base. @@ -129,6 +129,9 @@ function createOrUpdateBranch(git, commitMessage, base, branch, branchRemoteName if (signoff) { params.push('--signoff'); } + if (gpgSign) { + params.push('--gpg-sign'); + } yield git.commit(params); } // Perform fetch and reset the working base @@ -375,7 +378,7 @@ function createPullRequest(inputs) { core.endGroup(); // Create or update the pull request branch core.startGroup('Create or update the pull request branch'); - const result = yield create_or_update_branch_1.createOrUpdateBranch(git, inputs.commitMessage, inputs.base, inputs.branch, branchRemoteName, inputs.signoff); + const result = yield create_or_update_branch_1.createOrUpdateBranch(git, inputs.commitMessage, inputs.base, inputs.branch, branchRemoteName, inputs.signoff, inputs.gpgSign); core.endGroup(); if (['created', 'updated'].includes(result.action)) { // The branch was created or updated @@ -1070,6 +1073,7 @@ function run() { 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'), diff --git a/report.txt b/report.txt new file mode 100644 index 0000000..b2d7e2d --- /dev/null +++ b/report.txt @@ -0,0 +1 @@ +1620523034