From c9a27d9b91d592bb8200f4c2e047f2cd44b290cc Mon Sep 17 00:00:00 2001 From: luohoufu Date: Thu, 5 Dec 2024 11:02:34 +0800 Subject: [PATCH] Chore: add commit message check --- .github/workflows/commit-message-check.yml | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/commit-message-check.yml diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml new file mode 100644 index 00000000..f19dde70 --- /dev/null +++ b/.github/workflows/commit-message-check.yml @@ -0,0 +1,36 @@ +name: 'commit-message-check' +on: + pull_request: + +jobs: + check-commit-message: + name: check-subject + runs-on: ubuntu-latest + steps: + - name: check-subject-type + uses: gsactions/commit-message-checker@v2 + with: + checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request + excludeDescription: 'true' # optional: this excludes the description body of a pull request + excludeTitle: 'true' # optional: this excludes the title of a pull request + accessToken: ${{ secrets.GITHUB_TOKEN }} + pattern: '^(Change:|Feature:|Improve:|Perf:|Dep:|Doc:|Test:|CI:|Refactor:|Fix:|Fixdoc:|Fixup:|Merge|BumpVer:|Chore:|Build\(deps\):) .+$' + flags: 'gm' + error: | + Subject line has to contain a commit type, e.g.: "Change: blabla" or a merge commit e.g.: "Merge xxx". + Valid types are: + Change - API breaking change + Feature - API compatible new feature + Improve - Become better without functional changes + Perf - Performance improvement + Dep - dependency update + Doc - doc update + Test - test udpate + CI - CI workflow update + Refactor - refactor without function change. + Fix - fix bug + Fixdoc - fix doc + Fixup - minor change: e.g., fix sth mentioned in a review. + BumpVer - Bump to a new version. + Chore - Nothing important. + Build(deps) - bot: dependabot. \ No newline at end of file