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

[FEATURE] Skip merge commits in pull requests #79

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

GriceTurrble
Copy link

Merge commits can be identified by having two parent commits, so we add to the GraphQL query selecting PR commits to also return parents.totalCount. This shows any standard commit having 1 parent, and merge commits having 2.

We can then .filter() out those instances before mapping commit messages.

Should fix #75


Note that TypeScript/JavaScript are not my strong suit. I would appreciate assistance in adding tests and perhaps bringing the same check to the push event.

src/input-helper.ts Show resolved Hide resolved
src/input-helper.ts Outdated Show resolved Hide resolved
@gilbertsoft gilbertsoft changed the title feat: skip merge commits in pull requests [FEATURE] Skip merge commits in pull requests Oct 20, 2022
Merge commits can be identified by having two parent commits,
so we add to the GraphQL query selecting PR commits
to also return `parents.totalCount`.
This shows any standard commit having 1 parent,
and merge commits having 2.

We can then `.filter()` out those instances before mapping commit messages.
@gilbertsoft
Copy link
Member

gilbertsoft commented Oct 20, 2022

Thanks for your PR @GriceTurrble . In the meantime I've extended the tests and also added the feature to the push event.

asdil12 added a commit to asdil12/os-autoinst that referenced this pull request Nov 4, 2022
If branch names are too long, the tests would fail.
This will only come into action when this is merged:
GsActions/commit-message-checker#79
asdil12 added a commit to asdil12/os-autoinst that referenced this pull request Nov 4, 2022
If branch names are too long, the tests would fail.
This will only come into action when this is merged:
GsActions/commit-message-checker#79
@simoneversienti
Copy link

Skipping merge commits is an interesting and useful feature. is this PR still valid?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude merge commits from checks
3 participants