From a9add9ce72576580f14d1a74494bd917037c5628 Mon Sep 17 00:00:00 2001 From: Hannes Date: Tue, 11 Jun 2024 02:44:28 +0200 Subject: [PATCH] zess: add commit message check workflow --- .github/workflows/commit_message_check.yml | 29 ++++++++++++++++++++++ 1 file changed, 29 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..8fc18df --- /dev/null +++ b/.github/workflows/commit_message_check.yml @@ -0,0 +1,29 @@ +name: commit message check +run-name: commit message check +on: [push] + +jobs: + check_commit_messages: + runs-on: ubuntu-latest + + steps: + - name: checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: check commit messages + run: | + git log --format="%s" origin/main..HEAD | while IFS= read -r message; do + if ! [[ $message =~ ^(vingo:|vinscant:|vinvoor:|zess:) ]]; then + echo $message + echo "Error: commit message should start with vingo:|vinscant:|vinvoor:|zess: depending on which subproject you are working on." + exit 1 + fi + + if ! [[ $message =~ ^.*:\ [a-z].* ]]; then + echo $message + echo "Error: first letter after project specifier should be lower case" + exit 1 + fi + done