[CI] test committed

This commit is contained in:
peter-evans 2020-09-06 01:33:29 +00:00 committed by GitHub
parent 5ea31358e9
commit 5b1bff2be0
3 changed files with 18 additions and 8 deletions

View file

@ -27,6 +27,11 @@ inputs:
branch: branch:
description: 'The pull request branch name.' description: 'The pull request branch name.'
default: 'create-pull-request/patch' default: 'create-pull-request/patch'
delete-branch:
description: >
Delete the `branch` when closing pull requests, and when undeleted after merging.
Recommend `true`.
default: false
branch-suffix: branch-suffix:
description: 'The branch suffix type when using the alternative branching strategy.' description: 'The branch suffix type when using the alternative branching strategy.'
base: base:

20
dist/index.js vendored
View file

@ -1405,6 +1405,7 @@ function run() {
author: core.getInput('author'), author: core.getInput('author'),
signoff: core.getInput('signoff') === 'true', signoff: core.getInput('signoff') === 'true',
branch: core.getInput('branch'), branch: core.getInput('branch'),
deleteBranch: core.getInput('delete-branch') === 'true',
branchSuffix: core.getInput('branch-suffix'), branchSuffix: core.getInput('branch-suffix'),
base: core.getInput('base'), base: core.getInput('base'),
pushToFork: core.getInput('push-to-fork'), pushToFork: core.getInput('push-to-fork'),
@ -7035,16 +7036,19 @@ function createPullRequest(inputs) {
yield githubHelper.createOrUpdatePullRequest(inputs, baseRemote.repository, branchRepository); yield githubHelper.createOrUpdatePullRequest(inputs, baseRemote.repository, branchRepository);
} }
else { else {
// If there is no longer a diff with the base delete the branch // There is no longer a diff with the base
// Check we are in a state where a branch exists
if (['updated', 'not-updated'].includes(result.action)) { if (['updated', 'not-updated'].includes(result.action)) {
core.info(`Branch '${inputs.branch}' no longer differs from base branch '${inputs.base}'`); core.info(`Branch '${inputs.branch}' no longer differs from base branch '${inputs.base}'`);
core.info(`Closing pull request and deleting branch '${inputs.branch}'`); if (inputs.deleteBranch) {
yield git.push([ core.info(`Deleting branch '${inputs.branch}'`);
'--delete', yield git.push([
'--force', '--delete',
branchRemoteName, '--force',
`refs/heads/${inputs.branch}` branchRemoteName,
]); `refs/heads/${inputs.branch}`
]);
}
} }
} }
} }

1
report.txt Normal file
View file

@ -0,0 +1 @@
1599356009