Skip to content

DO NOT MERGE New target contracts v2 #556

DO NOT MERGE New target contracts v2

DO NOT MERGE New target contracts v2 #556

name: Enforce Pull Request Name
on:
pull_request:
types: [opened, edited, synchronize]
jobs:
enforce_pr_name:
runs-on: "k8s-native"
container:
image: "ubuntu:24.04"
steps:
- name: Enforce PR name
shell: bash
run: |
pr_title="${{ github.event.pull_request.title }}"
echo "Pull Request Title: $pr_title"
# Define a regex pattern for the expected PR title format
regular_branch_pattern='^(DEV|Dev)-([0-9]{3,}).*$'
hotfix_branch_pattern='^HF.*$'
release_candidate_branch_pattern='^RC.*$'
if [[ ! "$pr_title" =~ $regular_branch_pattern && ! "$pr_title" =~ $hotfix_branch_pattern && ! "$pr_title" =~ $release_candidate_branch_pattern ]]; then
echo "Error: PR title does not match the required format 'DEV-[ddd]' or 'HF' or 'RC'."
exit 1
fi
echo "PR title is correct."