diff --git a/.github/workflows/semantic-commit.yml b/.github/workflows/semantic-commit.yml new file mode 100644 index 000000000..87358282e --- /dev/null +++ b/.github/workflows/semantic-commit.yml @@ -0,0 +1,29 @@ +name: 'PR and Commit Message Check' +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + pull_request_target: + types: + - opened + - edited + - reopened + - synchronize + +jobs: + check-commit-message: + name: Check Commit Message + runs-on: ubuntu-latest + steps: + - name: Check Line Length + uses: gsactions/commit-message-checker@v2 + with: + pattern: '^(feat|fix|chore|docs|style|refactor|perf|ci|test)(\([\w\-]+\))?: [A-Z0-9].+' + error: 'Commit messages and PR title should match conventional commit convention and start with a majuscule.' + excludeDescription: 'true' + excludeTitle: 'false' + checkAllCommitMessages: 'true' + accessToken: ${{ secrets.GITHUB_TOKEN }}