From 1e294c77f80235dc71879af105e19a2f07032307 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 25 Aug 2026 20:37:08 -0700 Subject: [PATCH] ci: skip weblate commits and fetch pre-push tip Weblate translation pushes are not conventional, so ignore them. After a force-push the pre-push tip is unreachable from any ref, so commitlint cannot resolve the range without an explicit fetch. --- .github/workflows/test.yml | 4 ++++ commitlint.config.mjs | 1 + docs/agents/commits.md | 2 ++ 3 files changed, 7 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33dc79bcf..fc5906477 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,6 +38,10 @@ jobs: if: github.event_name == 'pull_request' run: pnpm exec commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose + - name: Fetch pre-push tip (unreachable after force-push) + if: github.event_name == 'push' && github.event.before != '0000000000000000000000000000000000000000' + run: git fetch origin ${{ github.event.before }} + - name: Lint push commits if: github.event_name == 'push' run: | diff --git a/commitlint.config.mjs b/commitlint.config.mjs index e3ed14672..c093a5adb 100644 --- a/commitlint.config.mjs +++ b/commitlint.config.mjs @@ -1,6 +1,7 @@ /** @type {import('@commitlint/types').UserConfig} */ const config = { extends: ['@commitlint/config-conventional'], + ignores: [(commit) => commit.includes('Translated using Weblate')], rules: { 'scope-enum': [ 2, diff --git a/docs/agents/commits.md b/docs/agents/commits.md index bfe72f1e2..1bd6f0101 100644 --- a/docs/agents/commits.md +++ b/docs/agents/commits.md @@ -2,6 +2,8 @@ Conventional Commits for history that can feed release notes and scoped changelogs. Enforced by commitlint (`commitlint.config.mjs`) and the Test workflow. +Automatic Weblate translation commits (subject `Translated using Weblate`) are skipped via the config's `ignores` list, since they do not follow the conventional format. + ## Format ```