BlueGit

ict rusty-teams

Files

rusty-teams / .github / workflows / pr-title.yml

pr-title.yml

pr-title.yml 804 B Download Raw
1# A squash merge uses the PR title as the commit subject, and the release notes
2# (cliff.toml) show it as is. CONTRIBUTING.md has the format.
3name: PR title
4
5on:
6 pull_request:
7 types: [opened, edited, reopened, synchronize]
8
9permissions: {}
10
11jobs:
12 title:
13 name: Conventional title
14 runs-on: ubuntu-latest
15 steps:
16 - name: Check
17 env:
18 TITLE: ${{ github.event.pull_request.title }}
19 run: |
20 pattern='^(feat|fix|perf|refactor|docs|test|chore|ci|build)(\([a-z0-9-]+\))?!?: [^[:space:]].*$'
21 if [[ "$TITLE" =~ $pattern ]]; then
22 echo "ok: $TITLE"
23 else
24 echo "::error::PR title must look like 'fix(chat): a sent image no longer blinks' (type(scope): message, no emoji). Got: $TITLE"
25 exit 1
26 fi