NO-ISSUE Create title check workflow #30

Merged
squid merged 2 commits from NO-ISSUE_pr_title_check_workflow into main 2025-01-21 08:21:52 +08:00
2 changed files with 20 additions and 1 deletions

View File

@ -33,6 +33,5 @@ body:
attributes: attributes:
label: Checklist label: Checklist
options: options:
- label: "The title is meet the format `'BLOG-XXX Title title title'`"
- label: A milestone is set - label: A milestone is set
- label: The related issuse has been linked to this branch - label: The related issuse has been linked to this branch

View File

@ -0,0 +1,20 @@
name: PR Title Check
on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened
jobs:
pr-title-check:
runs-on: ubuntu-latest
steps:
- name: Check PR title
run: |
title="${{ gitea.event.pull_request.title }}"
echo "Checking PR title: $title"
echo "$title" | grep -qE '^(BLOG-[0-9]+|NO-ISSUE) [A-Z].+$' \
&& echo 'Pass' \
|| (echo 'The title is not meet the format `BLOG-XXX Title title title`'; exit 1)