NO-ISSUE feat: pr title check workflow
Some checks failed
Frontend CI / build (push) Successful in 1m21s
PR Title Check / pr-title-check (pull_request) Failing after 16s

This commit is contained in:
SquidSpirit 2025-01-20 23:28:27 +08:00
parent 15d1bcb823
commit 1ffeba7da8
2 changed files with 19 additions and 1 deletions

View File

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

View File

@ -0,0 +1,19 @@
name: PR Title Check
on: [pull_request]
jobs:
pr-title-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check PR title
run: |
title=${{ gitea.event.pull_request.title }}
if [[ ! $title =~ ^(BLOG-[0-9]+|NO-ISSUE) [A-Z].+$ ]]; then
echo 'The title is not meet the format `BLOG-XXX Title title title`'
exit 1
else
echo 'Pass'
fi