From 05d8399cdf9f495e40342158677a0bc8ff2adb38 Mon Sep 17 00:00:00 2001 From: dylanhuang Date: Tue, 16 Aug 2022 19:01:24 +0800 Subject: [PATCH] ci: add commit message lint (#1044) --- .github/commitlint.config.js | 38 ++++++++++++++++++++++++++ .github/workflows/commit-lint.yml | 45 +++++++++++++++++++++++++++++++ docs/lint/commit.md | 26 ++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 .github/commitlint.config.js create mode 100644 .github/workflows/commit-lint.yml create mode 100644 docs/lint/commit.md diff --git a/.github/commitlint.config.js b/.github/commitlint.config.js new file mode 100644 index 000000000..b4e9a4a08 --- /dev/null +++ b/.github/commitlint.config.js @@ -0,0 +1,38 @@ +const validateTypeNums = (parsedCommit) => { + if (!parsedCommit.type) { + return [false, 'invalid commit message'] + } + + const types = parsedCommit.type.split(' ') + for (var i=0;i