From 6882288cf6da3318b03410d286078280b181cc82 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Sun, 28 Jun 2026 01:23:45 +0100 Subject: [PATCH] ci: enforce commit convention (#1203) --- .github/workflows/i18n-source-sync.yaml | 6 +++--- .github/workflows/i18n-weblate-pr.yaml | 4 ++-- .github/workflows/validate.yaml | 28 +++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/validate.yaml diff --git a/.github/workflows/i18n-source-sync.yaml b/.github/workflows/i18n-source-sync.yaml index 8f2282f9b..a95ef7412 100644 --- a/.github/workflows/i18n-source-sync.yaml +++ b/.github/workflows/i18n-source-sync.yaml @@ -68,7 +68,7 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git switch -c "$SOURCE_BRANCH" git add fluxer_app/src/features/i18n/locales fluxer_marketing/locales packages/errors/src/i18n fluxer_api/pkgs/email/src/email_i18n fluxer_api/src/api/content_i18n - git commit -m "i18n: refresh source catalogs" + git commit -m "chore(i18n): refresh source catalogs" git fetch origin "$SOURCE_BRANCH" || true git push --force-with-lease="refs/heads/$SOURCE_BRANCH" origin "HEAD:$SOURCE_BRANCH" @@ -80,7 +80,7 @@ jobs: BODY )" if [[ -z "$pr_number" ]]; then - gh pr create --base main --head "$SOURCE_BRANCH" --title "i18n: refresh source catalogs" --body "$body" + gh pr create --base main --head "$SOURCE_BRANCH" --title "chore(i18n): refresh source catalogs" --body "$body" else - gh pr edit "$pr_number" --title "i18n: refresh source catalogs" --body "$body" + gh pr edit "$pr_number" --title "chore(i18n): refresh source catalogs" --body "$body" fi diff --git a/.github/workflows/i18n-weblate-pr.yaml b/.github/workflows/i18n-weblate-pr.yaml index 149bc3f67..5080461e7 100644 --- a/.github/workflows/i18n-weblate-pr.yaml +++ b/.github/workflows/i18n-weblate-pr.yaml @@ -87,7 +87,7 @@ jobs: BODY )" if [[ -z "$pr_number" ]]; then - gh pr create --base main --head "$WEBLATE_BRANCH" --title "i18n: update translations from Weblate" --body "$body" + gh pr create --base main --head "$WEBLATE_BRANCH" --title "chore(i18n): update translations from Weblate" --body "$body" else - gh pr edit "$pr_number" --title "i18n: update translations from Weblate" --body "$body" + gh pr edit "$pr_number" --title "chore(i18n): update translations from Weblate" --body "$body" fi diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 000000000..3c16d2fed --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,28 @@ +name: Validate + +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + +permissions: {} + +jobs: + validate-title: + name: Validate title + runs-on: ubuntu-latest + steps: + - name: Validate pull request title + env: + TITLE: ${{ github.event.pull_request.title }} + run: | + REGEX="^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\\(.+\\))?!?: .{1,72}$" + + echo "Title: \"$TITLE\"" + + if [[ ! "$TITLE" =~ $REGEX ]]; then + exit 1 + fi