Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge commits bypass the checks #108

Closed
mrchief opened this issue Jun 18, 2021 · 4 comments · Fixed by #127
Closed

Merge commits bypass the checks #108

mrchief opened this issue Jun 18, 2021 · 4 comments · Fixed by #127

Comments

@mrchief
Copy link

mrchief commented Jun 18, 2021

Similar to #86 but simply checking for commitLength > 1 doesn't seem sufficient any longer. This is because if you have a merge commit (update branch to latest e.g.) then you have a single commit + 1 merge commit so the length check passes. But Github still ignores the merge commit and treats it as a single commit PR. Could be a recent change in Github's behavior.

PR
image

Commit that landed in main
image

@mrchief
Copy link
Author

mrchief commented Jun 18, 2021

Nevermind. Didn't realize validateSingleCommit: true was opt-in. Closing this for now

@mrchief mrchief closed this as completed Jun 18, 2021
@julianpoy
Copy link
Contributor

Mind re-opening this issue? GitHub now does not count merge commits in it's decision-making on whether to use the PR title as the squashed commit title. Now, if you have a single non-semantic commit and then use the "update branch" button, GitHub will still choose the single commit as the squashed commit title.

@amannn

@mrchief
Copy link
Author

mrchief commented Oct 23, 2021

@julianpoy that is news to me. I'm reopening this issue as I see you have a fix ready too! Waiting on @amannn to provide direction here.

@mrchief mrchief reopened this Oct 23, 2021
amannn added a commit that referenced this issue Oct 26, 2021
* fix: Single commit validation does not factor in merge commits [#108]

Closes #108

With a recent change, GitHub no longer factors in merge commits added by the "update branch" button into whether to use the PR title. If a dev submits a PR with a single commit, then presses the "update branch" button, action-semantic-pull-request will allow the branch to be merged, however GitHub will still use the commit title rather than the PR title.

* chore: Lint fix

* chore: Add comments to explain logic

* chore: Fix typo

* Minor rephrasing of comments

* Fix lint

Co-authored-by: Jan Amann <[email protected]>
@github-actions
Copy link

🎉 This issue has been resolved in version 3.4.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

julianpoy added a commit to julianpoy/action-semantic-pull-request that referenced this issue Oct 26, 2021
julianpoy added a commit to julianpoy/action-semantic-pull-request that referenced this issue Oct 26, 2021
julianpoy added a commit to julianpoy/action-semantic-pull-request that referenced this issue Oct 26, 2021
amannn pushed a commit that referenced this issue Oct 28, 2021
* fix: Single commit validation does not factor in merge commits [#108]

* fix: Use octokit paginate iterator for perf

* feat: Add validateSingleCommit job for validation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants