#86a3tvdqe - Adjust PR title pattern #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Pull Request Title Check" | |
on: | |
pull_request: | |
branches: ["main", "develop"] | |
types: [opened, edited, reopened, synchronize ] | |
jobs: | |
title-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check PR title | |
run: | | |
PR_TITLE="${{ github.event.pull_request.title }}" | |
REQUIRED_PATTERN="^((#[a-zA-Z0-9_]+),\s)*#[a-zA-Z0-9_]+\s-\s.+$" | |
if ! echo "$PR_TITLE" | grep -q -E "$REQUIRED_PATTERN"; then | |
echo "PR title is not valid!" | |
echo "Expected pattern: #<item_id> - <description>" | |
echo "Current title: $PR_TITLE" | |
exit 1 | |
else | |
echo "PR title is OK!" | |
exit 0 | |
fi |