From d8572c42be03040e9e16ab91e96b2675f173f37c Mon Sep 17 00:00:00 2001 From: peter-evans <peter-evans@users.noreply.github.com> Date: Fri, 31 Jul 2020 08:09:36 +0000 Subject: [PATCH] [CI] test committed --- action.yml | 3 +++ dist/index.js | 11 ++++++++--- report.txt | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 report.txt diff --git a/action.yml b/action.yml index 36f51a2..c306a7b 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,9 @@ inputs: The author name and email address in the format `Display Name <email@address.com>`. Defaults to the user who triggered the workflow run. default: '${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>' + signoff: + description: 'Add `Signed-off-by` line by the committer at the end of the commit log message.' + 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 550235a..687a1b3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1057,7 +1057,7 @@ function splitLines(multilineString) { .map(s => s.trim()) .filter(x => x !== ''); } -function createOrUpdateBranch(git, commitMessage, base, branch, branchRemoteName) { +function createOrUpdateBranch(git, commitMessage, base, branch, branchRemoteName, signoff) { return __awaiter(this, void 0, void 0, function* () { // Get the working base. This may or may not be the actual base. const workingBase = yield git.symbolicRef('HEAD', ['--short']); @@ -1077,7 +1077,11 @@ function createOrUpdateBranch(git, commitMessage, base, branch, branchRemoteName if (yield git.isDirty(true)) { core.info('Uncommitted changes found. Adding a commit.'); yield git.exec(['add', '-A']); - yield git.commit(['-m', commitMessage]); + const params = ['-m', commitMessage]; + if (signoff) { + params.push('--signoff'); + } + yield git.commit(params); } // Perform fetch and reset the working base // Commits made during the workflow will be removed @@ -1296,6 +1300,7 @@ function run() { commitMessage: core.getInput('commit-message'), committer: core.getInput('committer'), author: core.getInput('author'), + signoff: core.getInput('signoff') === 'true', branch: core.getInput('branch'), branchSuffix: core.getInput('branch-suffix'), base: core.getInput('base'), @@ -10578,7 +10583,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); + const result = yield create_or_update_branch_1.createOrUpdateBranch(git, inputs.commitMessage, inputs.base, inputs.branch, branchRemoteName, inputs.signoff); core.endGroup(); if (['created', 'updated'].includes(result.action)) { // The branch was created or updated diff --git a/report.txt b/report.txt new file mode 100644 index 0000000..55084a8 --- /dev/null +++ b/report.txt @@ -0,0 +1 @@ +1596182976