fix: Single commit validation does not factor in merge commits [#108] #130
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.
See julianpoy#2 for validation that this works.
Continuation of #127
The problem with the original PR was that GitHub API returns a list of
commits
each with a propertycommit
inside. When mapping overcommits => commit
, I forgot to add an additional chain forcommits => commit.commit
.I also noticed that validatePrTitle should check the nonMergeCommit that we found in the case that there is, in fact, only one commit, rather than any one of the commits in case the first commit returned is a merge commit (for some strange reason).
Lastly, I noticed that the test workflows included in this repository (the one titled
current branch
) don't use any of the additional options that this repo has to offer, such as thevalidateSingleCommit
option. I would recommend that thecurrent branch
workflow test for this repository either include these options, or that there be multiple workflows defined - one for each option.