-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.77 KB
/
Copy pathpr-title-check.yml
File metadata and controls
60 lines (49 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Validate PR Title
on:
pull_request:
types: [opened, edited, synchronize, reopened]
permissions:
pull-requests: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Validate PR title format
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
set -euo pipefail
if [ -z "${PR_TITLE:-}" ]; then
echo "PR title is missing from event payload"
exit 1
fi
REGEX='^(feat|enhance|fix|perf|refactor|docs|test|chore|ci|build|repo)\((repo|docs|demo|core|fields|builder|renderer|renderer-standalone|renderer-blaze|adapters)\): .+$'
if [[ "$PR_TITLE" =~ $REGEX ]]; then
echo "PR title is valid: $PR_TITLE"
exit 0
fi
cat <<'EOF'
PR title must follow conventional commits format:
feat(scope): descriptionP
enhance(scope): description
fix(scope): description
perf(scope): description
refactor(scope): description
docs(scope): description
test(scope): description
chore(scope): description
ci(scope): description
build(scope): description
repo(scope): description
Allowed tags:
feat, enhance, fix, perf, refactor, docs, test, chore, ci, build, repo
Allowed scopes:
repo, docs, demo, core, fields, builder, renderer, renderer-standalone, renderer-blaze, adapters
Examples:
repo(repo): update CI workflow
chore(repo): update ci workflow
docs(docs): add quickstart links
enhance(renderer): improve empty state
fix(renderer): handle empty schema
EOF
exit 1