name: '📜 Check Commit Messages'

on:
  pull_request:
    branches:    
      - 'master'

jobs:
  check-commit-messages:
    runs-on: ubuntu-latest
    steps:
      - name: '📜 Check commit messages format'
        uses: gsactions/commit-message-checker@v1
        with:
          pattern: '^[^!]+: [A-Za-z]+.+ .+\.$'
          flags: 'gm'
          error: 'Commit subject line must match the following pattern: <scope>: <description>.'
          excludeTitle: 'true'
          excludeDescription: 'true'
          checkAllCommitMessages: 'true'
          accessToken: ${{ secrets.GITHUB_TOKEN }}
      - name: '📜 Check commit messages length'
        uses: gsactions/commit-message-checker@v1
        with:
          pattern: '^[^#].{10,78}$'
          error: 'Commit subject line maximum line length of 78 characters is exceeded.'
          excludeTitle: 'true'
          excludeDescription: 'true'
          checkAllCommitMessages: 'true'
          accessToken: ${{ secrets.GITHUB_TOKEN }}

name: '📜 Check Commit Messages'

on:
  pull_request:
    types:
      - opened
      - edited
      - reopened
      - synchronize
    branches:    
      - 'master'

jobs:
  check-commit-messages:
    runs-on: ubuntu-latest
    steps:
      - name: '📜 Check commit messages format'
        uses: gsactions/commit-message-checker@v1
        with:
          pattern: '^[^!]+: [A-Za-z]+.+ .+\.$'
          flags: 'gm'
          error: 'Commit subject line must match the following pattern: <scope>: <description>.'
          excludeTitle: 'false'
          excludeDescription: 'true'
          checkAllCommitMessages: 'true'
          accessToken: ${{ secrets.GITHUB_TOKEN }}
      - name: '📜 Check commit messages length'
        uses: gsactions/commit-message-checker@v1
        with:
          pattern: '^[^#].{10,78}$'
          error: 'Commit subject line maximum line length of 78 characters is exceeded.'
          excludeTitle: 'false'
          excludeDescription: 'true'
          checkAllCommitMessages: 'true'
          accessToken: ${{ secrets.GITHUB_TOKEN }}

Check pull request title in workflows.
github: Check pull request title in workflows.
