Compare commits

...

1 Commits

Author SHA1 Message Date
cbef2a13ee NO-ISSUE fix: if expression
All checks were successful
Frontend CI / build (push) Successful in 1m21s
PR Title Check / pr-title-check (pull_request) Successful in 13s
2025-01-20 23:56:50 +08:00

View File

@ -1,19 +1,20 @@
name: PR Title Check
on: [pull_request]
on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened
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
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)