From d855b03027555925560ecda7a3d7cd5d48cd3ae3 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 23 Jun 2021 16:48:34 +0200 Subject: [PATCH] tools: avoid fetch extra commits when validating commit messages PR-URL: https://github.com/nodejs/node/pull/39128 Reviewed-By: Mary Marchini --- .github/workflows/commit-lint.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 0f6fd639523..42e9dc05283 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -9,10 +9,12 @@ jobs: lint-commit-message: runs-on: ubuntu-latest steps: + - name: Compute number of commits in the PR + id: nb-of-commits + run: echo "::set-output name=nb::$((${{ github.event.pull_request.commits }} + 1))" - uses: actions/checkout@v2 with: - # Last 100 commits should be enough for a PR - fetch-depth: 100 + fetch-depth: ${{ steps.nb-of-commits.outputs.nb }} - name: Install Node.js uses: actions/setup-node@v2 with: