ci: update lint-commit-msg.sh script
This commit is contained in:
parent
33d01b8d4f
commit
7b8494d2b3
|
@ -2,11 +2,17 @@
|
||||||
|
|
||||||
# see https://github.com/conventional-changelog/commitlint/issues/885
|
# see https://github.com/conventional-changelog/commitlint/issues/885
|
||||||
|
|
||||||
if [ "${CI_COMMIT_BEFORE_SHA}" = "0000000000000000000000000000000000000000" ]
|
if [ "${CI_COMMIT_BEFORE_SHA}" = "0000000000000000000000000000000000000000" ];
|
||||||
then
|
then
|
||||||
echo "commitlint from HEAD^"
|
echo "commitlint from HEAD^"
|
||||||
npx commitlint --from=HEAD^
|
npx commitlint --from=HEAD^
|
||||||
else
|
else
|
||||||
echo "commitlint from ${CI_COMMIT_BEFORE_SHA}"
|
echo "commitlint from ${CI_COMMIT_BEFORE_SHA}"
|
||||||
npx commitlint --from="${CI_COMMIT_BEFORE_SHA}"
|
br=`git branch -r --contains ${CI_COMMIT_BEFORE_SHA}`
|
||||||
|
if [ ! -n $br ];
|
||||||
|
then
|
||||||
|
npx commitlint --from=HEAD^
|
||||||
|
else
|
||||||
|
npx commitlint --from="${CI_COMMIT_BEFORE_SHA}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue