This repository was archived by the owner on Mar 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed
Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 2020
2121 steps :
2222 - uses : actions/checkout@v2
23+ with :
24+ fetch-depth : 0
2325
2426 - name : Setup node
2527 uses : actions/setup-node@v2
3335
3436 - name : Check commit message
3537 if : ${{ github.event_name == 'pull_request' }}
36- run : yarn commitlint ${{ github.context.payload.before }}
38+ run : yarn commitlint ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
3739
3840 - name : Linting & Unit testing
3941 run : |
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- CONVENTIONAL_COMMIT_REGEX=' ^(fix|feat|chore|docs|refactor)(\([[:alnum:]_]+\))?!?:[[:space:]][^[:space:]](.*)[^.]$'
3+ CONVENTIONAL_COMMIT_REGEX=' ^(fix|feat|chore|docs|refactor|ci )(\([[:alnum:]_]+\))?!?:[[:space:]][^[:space:]](.*)[^.]$'
44
55function usage {
66 cat << EOF
7- Usage: $( basename $0 ) [commitish ]
7+ Usage: $( basename $0 ) [range ]
88
9- The optional argument indicates the commit to start the check from,
10- and the range that is checked will be <commitish>..HEAD.
11- Note that the commitish itself is not included (to start from
12- e.g. fa56eb, you would write fa56eb~ to use the parent as starting
13- point).
14-
15- If no commitish is given, HEAD~ is used (so only the current commit
9+ If no range is given, HEAD~..HEAD is used (so only the latest commit
1610 will be checked).
1711
12+ Note that the a range fa56eb..HEAD does not include the fa56eb commit
13+ (to start from e.g. fa56eb, you would write fa56eb~..HEAD to use the parent
14+ as starting point).
15+
1816 Check if message conforms to a conventional commit message, see
1917 https://www.conventionalcommits.org/en/v1.0.0/#specification
2018EOF
2119}
2220
23- start =" HEAD~"
21+ range =" HEAD~..HEAD "
2422if [[ ! -z " $1 " ]]; then
25- start =" $1 "
23+ range =" $1 "
2624fi
2725
28- for sha in $( git rev-list " $start ..HEAD " ) ; do
26+ for sha in $( git rev-list " $range " || exit 1 ) ; do
2927 msg=$( git log -1 --format=" %s" $sha )
3028 if [[ ! " $msg " =~ $CONVENTIONAL_COMMIT_REGEX ]]; then
3129 echo " bad commit message:"
You can’t perform that action at this time.
0 commit comments