GsActions / commit-message-checker

GitHub Action that checks commit messages of pushes and pull request against a regex pattern
MIT License
99 stars 56 forks source link

[Feature Request] Check if PR description exists #45

Closed anthonyma94 closed 2 years ago

anthonyma94 commented 3 years ago

Hi, I'm wondering if there can be a boolean flag to check if a PR description exists. I'd like to be able to check if a description exists given a specific pattern for PR title :)

gilbertsoft commented 3 years ago

@anthonyma94 can you please provide some more information, I don't fully understand what you are trying to achieve. Some examples may be good...

anthonyma94 commented 3 years ago

Sorry about that, I'll include some examples:

This is valid since there is text in the description image

This is invalid since there is no text in the description image

Currently if the second PR is submitted and the excludeTitle flag is true, the action succeeds with the message No commits found in the payload, skipping check.

gilbertsoft commented 3 years ago

If you like to enforce a description something like this may do it:

"$.+\n\n.+"

Does this help or do you still need something else?

anthonyma94 commented 3 years ago

Unfortunately that doesn't work. If the description is empty while the excludeTitle flag is set to true, the action skips any checks and displays No commits found in the payload, skipping check.

gilbertsoft commented 3 years ago

Unfortunately that doesn't work. If the description is empty while the excludeTitle flag is set to true, the action skips any checks and displays No commits found in the payload, skipping check.

Why do you need to set excludeTitle at all? And did you set excludeTitle to true? Without only the PR descriptioin is takken into account.

grafik

anthonyma94 commented 3 years ago

I wanted to check for description based on the title regex. Do you have any suggestions for that?