[CI] test committed

This commit is contained in:
peter-evans 2020-09-05 09:49:01 +00:00 committed by GitHub
parent 5ea31358e9
commit 1b7b79dcb3
2 changed files with 11 additions and 3 deletions

13
dist/index.js vendored
View file

@ -3080,9 +3080,16 @@ function createOrUpdateBranch(git, commitMessage, base, branch, branchRemoteName
core.info(`Pull request branch '${branch}' already exists as remote branch '${branchRemoteName}/${branch}'`);
// Checkout the pull request branch
yield git.checkout(branch);
if (yield hasDiff(git, branch, tempBranch)) {
// If the branch differs from the recreated temp version then the branch is reset
// For changes on base this action is similar to a rebase of the pull request branch
// Reset the branch if one of the following conditions is true.
// - If the branch differs from the recreated temp branch.
// - If the recreated temp branch is not ahead of the base. This means there will be
// no pull request diff after the branch is reset. This catches a case where the
// branch was squash merged but not deleted. We need to reset to make sure it
// doesn't appear to have a diff with the base due to different commits for the
// same changes.
// For changes on base this reset is equivalent to a rebase of the pull request branch.
if ((yield hasDiff(git, branch, tempBranch)) ||
!(yield isAhead(git, base, tempBranch))) {
core.info(`Resetting '${branch}'`);
// Alternatively, git switch -C branch tempBranch
yield git.checkout(branch, tempBranch);

1
report.txt Normal file
View file

@ -0,0 +1 @@
1599299340