File tree 1 file changed +12
-7
lines changed
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 7
7
# - type-123-description -> type: #123
8
8
# - 123-description -> #123
9
9
# - 123-GH-124-description -> #123 GH-124
10
- # - some-description ->
10
+ # - some-description ->
11
11
12
- LAST_EXIT_CODE=$?
13
12
COMMIT_MSG_FILE=" $1 "
14
13
15
- EXCLUDED_BRANCHES=(" master" " main" " dev" )
16
- CURRENT_BRANCH=$( git symbolic-ref --quiet --short HEAD)
17
-
18
- # Abort during merges/rebases and on excluded branches
19
- if [ $LAST_EXIT_CODE -ne 0 ] || [[ ${EXCLUDED_BRANCHES[*]} =~ $CURRENT_BRANCH ]]; then
14
+ # Abort during merges/rebases
15
+ LAST_EXIT_CODE=$?
16
+ if [ $LAST_EXIT_CODE -ne 0 ]; then
20
17
exit 0
21
18
fi
22
19
@@ -25,6 +22,14 @@ if [ -n "$(head -n 1 "$COMMIT_MSG_FILE")" ]; then
25
22
exit 0
26
23
fi
27
24
25
+ # Abort on excluded branches
26
+ EXCLUDED_BRANCHES=(" master" " main" " dev" )
27
+ CURRENT_BRANCH=$( git symbolic-ref --quiet --short HEAD)
28
+ if [[ ${EXCLUDED_BRANCHES[*]} =~ $CURRENT_BRANCH ]]; then
29
+ exit 0
30
+ fi
31
+
32
+ # Build array of conventional commit types
28
33
CONVENTIONAL_COMMIT_TYPES=(" build" " chore" " ci" " docs" " feat" " fix" " perf" " refactor" " revert" " style" " test" )
29
34
for type in " ${CONVENTIONAL_COMMIT_TYPES[@]} " ; do
30
35
CONVENTIONAL_COMMIT_TYPES+=(" $type !" )
You can’t perform that action at this time.
0 commit comments