fix: return correct base_sha when merge_group event happens #145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
As reported in #140, the current solution for merge-queue works only when the queue size 1. When more commits are added to the queue, the action keeps setting the same
NX_BASE
for all of them.Problem
When new commits are added to the queue, we expect the
NX_BASE
commit to be the last commit in the queue. However, it sets the last commit in master. This image from #140 (comment) represents well the problem.Solution proposed
The
NX_BASE
commit should be main branch HEAD commit when merge-queue has size 1. When size > 1,NX_BASE
should be the HEAD commit of the last merge branch that current commit is on top of.