Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/check_pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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 grep -q "$jira_regex" <<< "$PR_TITLE"; 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
Loading