Skip to content

ADFA-781 enforce well formatted PR titles that refer to jira tickets #2

ADFA-781 enforce well formatted PR titles that refer to jira tickets

ADFA-781 enforce well formatted PR titles that refer to jira tickets #2

Workflow file for this run

name: Check PR Title for well-formed Jira issue
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
check_title:
runs-on: ubuntu-latest
steps:
- name: Check PR Title for JIRA Key
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
#!/bin/bash
jira_regex="ADFA-[0-9]+"
echo "<$jira_regex> <$PR_TITLE>"
if [[ "$PR_TITLE" =~ "$jira_regex" ]]; then
echo "PR title '$PR_TITLE' contains a valid JIRA issue key."
else
echo "Error: PR title '$PR_TITLE' does not contain a valid JIRA issue key. Please ensure your title includes a key in the format ADFA-XXXX."
exit 1
fi