Is there any way/API that I can integrate with Github to check the Jira ticket availability before merging PRs?

I want to put some check on creation of PR (pull request) in Github where it would check if the PR title contains any jira ticket id (eg. TES-102 Testing PR protection ) and also it should check if TES-102 is an actual ticket in jira. If it fails to do any of the things then github should not allow to create a PR.