-
Notifications
You must be signed in to change notification settings - Fork 153
32 lines (30 loc) · 1.38 KB
/
pr-prefix.yml
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
name: check-pr-title-prefix
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
check-pr-prefix:
runs-on: ubuntu-latest
steps:
- name: Check PR title prefix
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
if echo "$TITLE" | tr ':' '\n' | head -n 1 | grep -qE '^(feat|fix|docs?|refactor|ci|chore(\([^)]+\))?|deps)$';
then
echo "PR title is valid."
else
echo "PR title is invalid."
echo "Use the title prefixes like:"
echo " feat: (for new features and functionality)"
echo " fix: (for bug fixes and revisions on how things work)"
echo " doc: (for docs, docstring, and comment changes)"
echo " docs: (for docs, docstring, and comment changes)"
echo " refactor: (for refactoring and revisions on how things are related)"
echo " ci: (for changes related to CI/CD workflows)"
echo " chore: (for changes related to repo/build configs, tool dependencies, etc.)"
echo " chore(...): (for changes related to repo/build configs, tool dependencies, etc.)"
echo " deps: (for changes related to upstream dependencies, etc.)"
echo "following the conventional commit style."
exit 1
fi