diff options
author | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2021-11-17 22:49:38 +0100 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2021-11-26 15:36:36 +0100 |
commit | 6ebbd0d9dc9e4b3638320e876f28c3946bce133b (patch) | |
tree | 4af61c625f62960682b79b686ca48ca24103a488 | |
parent | 6e9b6652e51e8bd6c0f730ce5791e232dce33b9d (diff) | |
download | node-new-6ebbd0d9dc9e4b3638320e876f28c3946bce133b.tar.gz |
tools: fix commit-lint GH Actions CI
PR-URL: https://github.com/nodejs/node/pull/40845
Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r-- | .github/workflows/commit-lint.yml | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 1609d23940..0f0c6d6693 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -9,9 +9,15 @@ 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=plusOne::$((${{ github.event.pull_request.commits }} + 1))" + echo "::set-output name=minusOne::$((${{ github.event.pull_request.commits }} - 1))" - uses: actions/checkout@v2 with: - fetch-depth: 2 + fetch-depth: ${{ steps.nb-of-commits.outputs.plusOne }} + - run: git reset HEAD^2 - name: Install Node.js uses: actions/setup-node@v2 with: @@ -19,4 +25,4 @@ jobs: - name: Validate commit message run: | echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json" - git rev-parse HEAD^ | xargs npx -q core-validate-commit --no-validate-metadata --tap + git rev-parse HEAD~${{ steps.nb-of-commits.outputs.minusOne }} | xargs npx -q core-validate-commit --no-validate-metadata --tap |