Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2021-11-18 00:49:38 +0300
committerJames M Snell <jasnell@gmail.com>2021-11-25 23:14:40 +0300
commit27b10881d3544605f9541bc62286cea0bd1ab881 (patch)
treeb4ebd7b2f8d52520a48a11f03fef338eb9f78140 /.github
parent24292b46ba4942bc59f2b17f5033007aff259889 (diff)
tools: fix commit-lint GH Actions CI
PR-URL: https://github.com/nodejs/node/pull/40845 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/commit-lint.yml10
1 files changed, 8 insertions, 2 deletions
diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml
index 1609d239404..0f0c6d66938 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