From 420d6f0b7843b6c2f008c8ae5d3d8189160ff72f Mon Sep 17 00:00:00 2001 From: Copilot Date: Mon, 18 May 2026 21:30:05 +0200 Subject: [PATCH 1/5] chore(ci): add conventional commit message check Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/commit-message-check.yml | 66 ++++++++++++++++++++++ 1 file changed, 66 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 00000000..4512dcb7 --- /dev/null +++ b/.github/workflows/commit-message-check.yml @@ -0,0 +1,66 @@ +name: "Conventional Commit Message Check" + +on: + push: + branches: + - '**' + pull_request: + types: [opened, synchronize, reopened] + +jobs: + commit-message-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Lint commit messages + run: | + set -euo pipefail + echo "Event: ${{ github.event_name }}" + + if [ "${{ github.event_name }}" = "pull_request" ]; then + range="${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}" + else + before="${{ github.event.before }}" + sha="${{ github.sha }}" + if [ "$before" = "0000000000000000000000000000000000000000" ]; then + # new branch or initial push, check last commit only + range="$sha^..$sha" + else + range="$before..$sha" + fi + fi + + echo "Commit range: $range" + # list commit subjects, skip merge commits + commits=$(git log --no-merges --pretty=format:%s "$range" || true) + if [ -z "$commits" ]; then + echo "No commits found to lint." + exit 0 + fi + + failed=0 + while IFS= read -r subject; do + [ -z "$subject" ] && continue + # allow and skip merge commits if any slipped through + if echo "$subject" | grep -q -i "^Merge "; then + echo "Skipping merge commit: $subject" + continue + fi + + if ! echo "$subject" | grep -E -q '^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\([a-zA-Z0-9_.\/-]+\))?(!)?: .+'; then + echo "::error ::Conventional commit validation failed for: $subject" + failed=1 + else + echo "OK: $subject" + fi + done <<< "$commits" + + if [ $failed -ne 0 ]; then + echo "One or more commits do not follow Conventional Commits." + exit 1 + fi + From 7307de97e6a6baf4e3e980bc73f00dc4ab8b1fc0 Mon Sep 17 00:00:00 2001 From: Copilot Date: Mon, 18 May 2026 21:34:34 +0200 Subject: [PATCH 2/5] chore(ci): run commit message check only on pull_request Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/commit-message-check.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml index 4512dcb7..2f75b82b 100644 --- a/.github/workflows/commit-message-check.yml +++ b/.github/workflows/commit-message-check.yml @@ -1,9 +1,6 @@ name: "Conventional Commit Message Check" on: - push: - branches: - - '**' pull_request: types: [opened, synchronize, reopened] @@ -51,7 +48,7 @@ jobs: continue fi - if ! echo "$subject" | grep -E -q '^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\([a-zA-Z0-9_.\/-]+\))?(!)?: .+'; then + if ! echo "$subject" | grep -E -q '^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\([a-zA-Z0-9_.\-/]+\))?(!)?: .+'; then echo "::error ::Conventional commit validation failed for: $subject" failed=1 else @@ -63,4 +60,3 @@ jobs: echo "One or more commits do not follow Conventional Commits." exit 1 fi - From c84de45a093ac1f0ff5877ad9f988723e9bae39f Mon Sep 17 00:00:00 2001 From: Copilot Date: Mon, 18 May 2026 21:41:39 +0200 Subject: [PATCH 3/5] chore(ci): add PR Title Check workflow Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/pr-title-check.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/pr-title-check.yml diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml new file mode 100644 index 00000000..7042aa97 --- /dev/null +++ b/.github/workflows/pr-title-check.yml @@ -0,0 +1,28 @@ +name: "PR Title Check" + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + branches: + - gh-pages + - main + +permissions: + contents: read + +jobs: + conventional-pr-title: + runs-on: ubuntu-latest + + steps: + - name: Validate pull request title + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + pattern='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([[:alnum:]_.-]+\))?(!)?: .+$' + + if [[ ! "$PR_TITLE" =~ $pattern ]]; then + echo "PR title must follow Conventional Commits, for example: feat(ui): add route summary" + echo "Got: $PR_TITLE" + exit 1 + fi From 599ff1d141048e0324c186a7cc8887c2e3d0f9bb Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Mon, 18 May 2026 21:43:42 +0200 Subject: [PATCH 4/5] chore: delete file --- .github/workflows/commit-message-check.yml | 62 ---------------------- 1 file changed, 62 deletions(-) delete mode 100644 .github/workflows/commit-message-check.yml diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml deleted file mode 100644 index 2f75b82b..00000000 --- a/.github/workflows/commit-message-check.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: "Conventional Commit Message Check" - -on: - pull_request: - types: [opened, synchronize, reopened] - -jobs: - commit-message-lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Lint commit messages - run: | - set -euo pipefail - echo "Event: ${{ github.event_name }}" - - if [ "${{ github.event_name }}" = "pull_request" ]; then - range="${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}" - else - before="${{ github.event.before }}" - sha="${{ github.sha }}" - if [ "$before" = "0000000000000000000000000000000000000000" ]; then - # new branch or initial push, check last commit only - range="$sha^..$sha" - else - range="$before..$sha" - fi - fi - - echo "Commit range: $range" - # list commit subjects, skip merge commits - commits=$(git log --no-merges --pretty=format:%s "$range" || true) - if [ -z "$commits" ]; then - echo "No commits found to lint." - exit 0 - fi - - failed=0 - while IFS= read -r subject; do - [ -z "$subject" ] && continue - # allow and skip merge commits if any slipped through - if echo "$subject" | grep -q -i "^Merge "; then - echo "Skipping merge commit: $subject" - continue - fi - - if ! echo "$subject" | grep -E -q '^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\([a-zA-Z0-9_.\-/]+\))?(!)?: .+'; then - echo "::error ::Conventional commit validation failed for: $subject" - failed=1 - else - echo "OK: $subject" - fi - done <<< "$commits" - - if [ $failed -ne 0 ]; then - echo "One or more commits do not follow Conventional Commits." - exit 1 - fi From babd6da2713fab92ecea3b2afe0c907194f87b3f Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Mon, 18 May 2026 21:45:38 +0200 Subject: [PATCH 5/5] fix: run changes on master branch --- .github/workflows/pr-title-check.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml index 7042aa97..6e4e94f5 100644 --- a/.github/workflows/pr-title-check.yml +++ b/.github/workflows/pr-title-check.yml @@ -4,8 +4,7 @@ on: pull_request: types: [opened, edited, synchronize, reopened] branches: - - gh-pages - - main + - master permissions: contents: read