diff --git a/.github/workflows/lua_language_server.yml b/.github/workflows/lua_language_server.yml index d6a14cc2..1859c134 100644 --- a/.github/workflows/lua_language_server.yml +++ b/.github/workflows/lua_language_server.yml @@ -1,4 +1,4 @@ -name: Run Lua Language Server check +name: Lua Language Server Check on: workflow_call: diff --git a/.github/workflows/nightly_check.yml b/.github/workflows/nightly_check.yml index ef0a508c..594de13b 100644 --- a/.github/workflows/nightly_check.yml +++ b/.github/workflows/nightly_check.yml @@ -1,4 +1,4 @@ -name: Nightly Neovim check +name: Nightly Neovim Check # Checks LSP and unit tests against new Neovim nightly once a week on: diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 9be0d23c..464baa97 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -1,4 +1,4 @@ -name: Pull request check +name: Pull Request Check on: pull_request: @@ -54,3 +54,28 @@ jobs: - uses: actions/checkout@v2 - name: Block Fixup Commit Merge uses: 13rac1/block-fixup-merge-action@v2.0.0 + + conventional-commit: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Check Commit Messages + run: | + commits=$(git log --no-merges --pretty=format:"%s" HEAD~${{ github.event.pull_request.commits }}..HEAD) + bad_commits=() + for commit in "$commits"; do + if ! echo $commit | grep -qE "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.+\))?: .+"; then + bad_commits+=("$commit") + fi + done + if [[ ${#bad_commits[@]} -ne 0 ]]; then + echo "The following commits do not follow the Conventional Commit format:" + for bad_commit in "${bad_commits[@]}"; do + echo " - $bad_commit" + done + exit 1 + fi diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 18ec0e9d..0fc33cd5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Run tests +name: Unit Tests on: workflow_call: