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
Showing only changes of commit cbef2a13ee - Show all commits

View File

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