Skip to content

Commit

Permalink
Use NewMerge instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ellahathaway committed May 24, 2024
1 parent 6bd7eaf commit 77c6617
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,17 @@ private async Task CreateOrUpdatePullRequestAsync(TreeResponse parentTreeRespons
else
{
newBranchName = existingPullRequest.Head.Ref;

try
{
// Update the existing pull request with the latest from the target branch
await UpdateReferenceAsync(newBranchName, headSha);
// Merge the target branch into the existing pull request
var merge = new NewMerge(newBranchName, headSha);
var mergeResult = await _client.Repository.Merging.Create(_repoOwner, _repoName, merge);
}
catch (Exception e)
{
Log.LogWarning($"Failed to update the existing pull request with the latest from the target branch: {e.Message}");
Log.LogWarning("Continuing with PR updates, but you may need to manually merge in the target branch.");
Log.LogWarning($"Failed to merge the target branch into the existing pull request: {e.Message}");
Log.LogWarning("Continuing with updating the existing pull request. You may need to resolve conflicts manually in the PR.");
}

headSha = await GetHeadShaAsync(newBranchName);
Expand Down

0 comments on commit 77c6617

Please sign in to comment.