From 78cb854421d8cf09a4ae4e685f3d1871a7f1b7a2 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Wed, 14 Feb 2024 14:09:40 +0800 Subject: [PATCH] docs(ci): stop recommending HEAD~1 In a single-commit repo, this would lead to this error: ``` Error: fatal: ambiguous argument 'HEAD~1..HEAD': unknown revision or path not in the working tree. ``` Now that we have the `--last` flag, this should work for the case in which we want just to analyze the last commit, not specify a range of commits via `--from` and `--to`. Closes https://github.com/conventional-changelog/commitlint/pull/3892 --- docs/guides-ci-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides-ci-setup.md b/docs/guides-ci-setup.md index d98cbe15300..b5e5f853879 100644 --- a/docs/guides-ci-setup.md +++ b/docs/guides-ci-setup.md @@ -42,7 +42,7 @@ jobs: - name: Validate current commit (last commit) with commitlint if: github.event_name == 'push' - run: npx commitlint --from HEAD~1 --to HEAD --verbose + run: npx commitlint --last --verbose - name: Validate PR commits with commitlint if: github.event_name == 'pull_request'