From b5aa08d2f963bf0081d4b8538ee74a2265d492f2 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 30 Oct 2021 17:45:25 +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 0f6fd639523cb0..42e9dc05283730 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: