feat: added different PLUGIN Actions
This commit is contained in:
1 file changed
+15
-3
@@ -1,10 +1,22 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
git config --global --add safe.directory .
|
||||
|
||||
export
|
||||
if [ -z "${PLUGIN_ACTION}" ]; then
|
||||
PLUGIN_ACTION="last-commit"
|
||||
fi
|
||||
|
||||
|
||||
PARAM=""
|
||||
|
||||
commitlint -g /etc/commitlint.config.mjs -V -l
|
||||
if [ "${PLUGIN_ACTION}" == "last-commit" ]; then
|
||||
PARAM="$PARAM -l"
|
||||
elif [ "${PLUGIN_ACTION}" == "all-commits" ]; then
|
||||
PARAM="$PARAM -t HEAD"
|
||||
elif [ "${PLUGIN_ACTION}" == "branch-commits" ]; then
|
||||
PARAM="$PARAM -f origin/HEAD"
|
||||
else
|
||||
echo "Unknown PLUGIN_ACTION: ${PLUGIN_ACTION}"
|
||||
fi
|
||||
|
||||
commitlint -g /etc/commitlint.config.mjs ${PARAM}
|
||||
Reference in new issue
Block a user