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 ```