Skip to content

Commit d5a333f

Browse files
author
Eric Swanson
authored
chore: add conventional commits CI check (#4)
1 parent bc28c9d commit d5a333f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PR title format
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- reopened
7+
- edited
8+
- synchronize
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
check:
16+
name: conventional-pr-title:required
17+
runs-on: ubuntu-latest
18+
steps:
19+
# Conventional commit patterns:
20+
# verb: description
21+
# verb!: description of breaking change
22+
# verb(scope): Description of change to $scope
23+
# verb(scope)!: Description of breaking change to $scope
24+
# verb: feat, fix, ...
25+
# scope: refers to the part of code being changed. E.g. " (accounts)" or " (accounts,canisters)"
26+
# !: Indicates that the PR contains a breaking change.
27+
- env:
28+
TITLE: ${{ github.event.pull_request.title }}
29+
run: |
30+
echo "PR title: $TITLE"
31+
if [[ "$TITLE" =~ ^(feat|fix|chore|build|ci|docs|style|refactor|perf|test)(\([-a-zA-Z0-9,]+\))?\!?\: ]]; then
32+
echo pass
33+
else
34+
echo "PR title does not match conventions"
35+
exit 1
36+
fi

0 commit comments

Comments
 (0)