Is there way to validate the title and body of a GitHub Pull Request. I know that we can use Pull Request Template to prepopulate the pull Request message. Also GitHub does provide WebHooks , Checks API which run against each commit.
But I'm looking for some way in which we can validate the message body of Pull Request(like, look for the presence of a valid JIRA ID) when a the contributor hits the "Send Pull Request" button and based on validation accept or reject the Pull Request.
I am thinking of implementing this through a GitHub App, which will be installed on an org-level repo.
I am not concerned about checking the commits.
I came across ContentReferenceEvent which seems to provide a similar but incomplete feature where only the URL is read and content_reference
events are triggered. I was hoping this to provide a way for getting the title and body of PullRequest too.
However, Using content attachments says that this feature is only for beta use:
Note: The Content Attachments API is currently in public beta and only available for use with GitHub Apps. Features and requirements may change at any time during this period.
As this is in beta phase, I cannot use this feature.
Please let me know what other alternatives are out there OR how can I implement this on my own, if nothing like that already exists.