From f10ee551c7fdcb7373cc1c95a25868ec25c3bee2 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 14 Jan 2025 14:58:59 +0800 Subject: [PATCH 1/3] chore: commmit 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 0000000..fdfcf08 --- /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:|feat:|improve:|perf:|dep:|docs:|test:|ci:|style:|refactor:|fix:|fixdoc:|fixup:|merge|Merge|bumpver:|chore:|build:) .+$' + flags: 'gm' + error: | + Subject line has to contain a commit type, e.g.: "chore: blabla" or a merge commit e.g.: "merge xxx". + Valid types are: + change - API breaking change + feat - API compatible new feature + improve - Become better without functional changes + perf - Performance improvement + dep - dependency update + docs - docs 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 - bot: dependabot. \ No newline at end of file From e558b4d13e85192b8603521c5e5d53f7d9f9a026 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 14 Jan 2025 15:18:27 +0800 Subject: [PATCH 2/3] chore: title need check --- .github/workflows/commit-message-check.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml index fdfcf08..c132c31 100644 --- a/.github/workflows/commit-message-check.yml +++ b/.github/workflows/commit-message-check.yml @@ -12,7 +12,6 @@ jobs: 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:|feat:|improve:|perf:|dep:|docs:|test:|ci:|style:|refactor:|fix:|fixdoc:|fixup:|merge|Merge|bumpver:|chore:|build:) .+$' flags: 'gm' From 4c21576a5590f72f7fe81909d26e21c2f77a1e6b Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 14 Jan 2025 15:19:20 +0800 Subject: [PATCH 3/3] chore: update|Update for github --- .github/workflows/commit-message-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml index c132c31..98cf227 100644 --- a/.github/workflows/commit-message-check.yml +++ b/.github/workflows/commit-message-check.yml @@ -13,7 +13,7 @@ jobs: checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request excludeDescription: 'true' # optional: this excludes the description body of a pull request accessToken: ${{ secrets.GITHUB_TOKEN }} - pattern: '^(change:|feat:|improve:|perf:|dep:|docs:|test:|ci:|style:|refactor:|fix:|fixdoc:|fixup:|merge|Merge|bumpver:|chore:|build:) .+$' + pattern: '^(change:|feat:|improve:|perf:|dep:|docs:|test:|ci:|style:|refactor:|fix:|fixdoc:|fixup:|merge|Merge|update|Update|bumpver:|chore:|build:) .+$' flags: 'gm' error: | Subject line has to contain a commit type, e.g.: "chore: blabla" or a merge commit e.g.: "merge xxx".