[CI] test committed
This commit is contained in:
parent
71a37c5c33
commit
d8572c42be
3 changed files with 12 additions and 3 deletions
|
@ -21,6 +21,9 @@ inputs:
|
||||||
The author name and email address in the format `Display Name <email@address.com>`.
|
The author name and email address in the format `Display Name <email@address.com>`.
|
||||||
Defaults to the user who triggered the workflow run.
|
Defaults to the user who triggered the workflow run.
|
||||||
default: '${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>'
|
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:
|
branch:
|
||||||
description: 'The pull request branch name.'
|
description: 'The pull request branch name.'
|
||||||
default: 'create-pull-request/patch'
|
default: 'create-pull-request/patch'
|
||||||
|
|
11
dist/index.js
vendored
11
dist/index.js
vendored
|
@ -1057,7 +1057,7 @@ function splitLines(multilineString) {
|
||||||
.map(s => s.trim())
|
.map(s => s.trim())
|
||||||
.filter(x => x !== '');
|
.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* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// Get the working base. This may or may not be the actual base.
|
// Get the working base. This may or may not be the actual base.
|
||||||
const workingBase = yield git.symbolicRef('HEAD', ['--short']);
|
const workingBase = yield git.symbolicRef('HEAD', ['--short']);
|
||||||
|
@ -1077,7 +1077,11 @@ function createOrUpdateBranch(git, commitMessage, base, branch, branchRemoteName
|
||||||
if (yield git.isDirty(true)) {
|
if (yield git.isDirty(true)) {
|
||||||
core.info('Uncommitted changes found. Adding a commit.');
|
core.info('Uncommitted changes found. Adding a commit.');
|
||||||
yield git.exec(['add', '-A']);
|
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
|
// Perform fetch and reset the working base
|
||||||
// Commits made during the workflow will be removed
|
// Commits made during the workflow will be removed
|
||||||
|
@ -1296,6 +1300,7 @@ function run() {
|
||||||
commitMessage: core.getInput('commit-message'),
|
commitMessage: core.getInput('commit-message'),
|
||||||
committer: core.getInput('committer'),
|
committer: core.getInput('committer'),
|
||||||
author: core.getInput('author'),
|
author: core.getInput('author'),
|
||||||
|
signoff: core.getInput('signoff') === 'true',
|
||||||
branch: core.getInput('branch'),
|
branch: core.getInput('branch'),
|
||||||
branchSuffix: core.getInput('branch-suffix'),
|
branchSuffix: core.getInput('branch-suffix'),
|
||||||
base: core.getInput('base'),
|
base: core.getInput('base'),
|
||||||
|
@ -10578,7 +10583,7 @@ function createPullRequest(inputs) {
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
// Create or update the pull request branch
|
// Create or update the pull request branch
|
||||||
core.startGroup('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();
|
core.endGroup();
|
||||||
if (['created', 'updated'].includes(result.action)) {
|
if (['created', 'updated'].includes(result.action)) {
|
||||||
// The branch was created or updated
|
// The branch was created or updated
|
||||||
|
|
1
report.txt
Normal file
1
report.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
1596182976
|
Loading…
Reference in a new issue