How to enforce user to enter a JIRA ticket

Greetings

We have setup integration between JIRA Cloud and GitHub enterprise. We are able to see the commit, PR and branch details in JIRA development panel which user can navigate to view the details quickly

However, we want to enforce user to enter a JIRA ticket number in the git commit message. without a JIRA ticket number, the commit should fail. How to achieve this?

Can someone help me with some detailed steps so that I can try in a test this in sandbox environment? let me know if additional details are required. Thanks !

There are lots of ways to address this, but you could use something like:

Thanks. I took example workflow as is which is available at the following link and tried a commit push.

The push was successful even though commit message does not contain “BUGFIX” as defined in the action yml file.

I am expecting push to fail as it does not contain a valid commit message which is BUGFIX in this case.

Is there anything I am missing?

Actions can’t prevent pushes. If they are required checks, they can prevent GitHub from initiating merges to a branch. And if you have branch protection, that can prevent a push.

You need two things for this to work: