fix: use event.before SHA for synchronize diff#205
Open
Br1an67 wants to merge 1 commit intoanc95:mainfrom
Open
fix: use event.before SHA for synchronize diff#205Br1an67 wants to merge 1 commit intoanc95:mainfrom
Br1an67 wants to merge 1 commit intoanc95:mainfrom
Conversation
…mmits On synchronize events, the previous fallback only compared the last two commits in the PR. This misses changes when multiple commits are pushed at once. Now uses context.payload.before (the HEAD SHA before the push) to correctly capture all new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Use
context.payload.before(the HEAD SHA before the synchronize push) as the fallback comparison base instead of comparing the last two commits in the PR.Closes #202
Why
On
synchronizeevents, a push can contain multiple commits. The previous fallback only compared the last two commits (commits[n-2]..commits[n-1]), missing intermediate changes.event.beforeaccurately represents the PR HEAD before the push, sobefore..headcaptures all new changes.How
context.payload.beforeinstead ofcommits[commits.length - 2].shaTesting