2

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.

Asif Kamran Malick
  • 2,409
  • 3
  • 25
  • 47
  • One close vote already received for marking this question as Off-Topic. I beg for clarification. Which criterion/critera of https://stackoverflow.com/help/on-topic does this question satisfy. Please do mention the point number. – Asif Kamran Malick Apr 02 '20 at 15:39
  • Hi Asif. I am in need of this exact feature. Did you eventually build this as a GitHub App? Thanks. – tdmadeeasy Jun 21 '23 at 06:54
  • Following up, any update to this? – navraj Jul 13 '23 at 14:59

0 Answers0