From 0499b2da37628d661c2874278ec27db3ac2191f4 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 17 Nov 2021 22:49:38 +0100 Subject: [PATCH 1/9] tools: fix commit-lint GH Actions CI --- .github/workflows/commit-lint.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 1609d239404241..d42830f44dcd78 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -9,14 +9,18 @@ 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: - fetch-depth: 2 + fetch-depth: ${{ steps.nb-of-commits.outputs.nb }} - name: Install Node.js uses: actions/setup-node@v2 with: node-version: ${{ env.NODE_VERSION }} + - run: git --no-pager log HEAD~${{ steps.nb-of-commits.outputs.nb }} - 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.nb }} | xargs npx -q core-validate-commit --no-validate-metadata --tap From eb487e3ead97c7c1aac20a5147f2c5a237c1236b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 17 Nov 2021 22:55:01 +0100 Subject: [PATCH 2/9] fixup! tools: fix commit-lint GH Actions CI --- .github/workflows/commit-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index d42830f44dcd78..c81d7711944182 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -19,8 +19,8 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ env.NODE_VERSION }} - - run: git --no-pager log HEAD~${{ steps.nb-of-commits.outputs.nb }} + - run: git --no-pager log HEAD~${{ github.event.pull_request.commits }} - name: Validate commit message run: | echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json" - git rev-parse HEAD~${{ steps.nb-of-commits.outputs.nb }} | xargs npx -q core-validate-commit --no-validate-metadata --tap + git rev-parse HEAD~${{ github.event.pull_request.commits }} | xargs npx -q core-validate-commit --no-validate-metadata --tap From 570d4935ed6e031cd8b387d2a52a6bde5f354ec7 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 17 Nov 2021 23:02:09 +0100 Subject: [PATCH 3/9] fixup! fixup! tools: fix commit-lint GH Actions CI --- .github/workflows/commit-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index c81d7711944182..dcdca5490d6628 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -19,7 +19,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ env.NODE_VERSION }} - - run: git --no-pager log HEAD~${{ github.event.pull_request.commits }} + - run: git --no-pager log HEAD^ - name: Validate commit message run: | echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json" From b53176b758c6ff19945ef28791e65e3e3f3c1fb2 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 17 Nov 2021 23:05:53 +0100 Subject: [PATCH 4/9] fixup! fixup! fixup! tools: fix commit-lint GH Actions CI --- .github/workflows/commit-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index dcdca5490d6628..b508800136e7cb 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -19,7 +19,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ env.NODE_VERSION }} - - run: git --no-pager log HEAD^ + - run: git --no-pager log - name: Validate commit message run: | echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json" From fa162ef81f672dd4895d2b4641429df0a08aa065 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 17 Nov 2021 23:10:43 +0100 Subject: [PATCH 5/9] fixup! fixup! fixup! fixup! tools: fix commit-lint GH Actions CI --- .github/workflows/commit-lint.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index b508800136e7cb..45212fee6fd8ad 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -15,12 +15,12 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: ${{ steps.nb-of-commits.outputs.nb }} - - name: Install Node.js - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - run: git --no-pager log - - name: Validate commit message - run: | - echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json" - git rev-parse HEAD~${{ github.event.pull_request.commits }} | xargs npx -q core-validate-commit --no-validate-metadata --tap + - run: git --no-pager log HEAD^2~${{ github.event.pull_request.commits }} + # - name: Install Node.js + # uses: actions/setup-node@v2 + # with: + # node-version: ${{ env.NODE_VERSION }} + # - name: Validate commit message + # run: | + # echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json" + # git rev-parse HEAD~${{ github.event.pull_request.commits }} | xargs npx -q core-validate-commit --no-validate-metadata --tap From 5a5132ebb203b43ab7f2c481b5544b3101a6cec6 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 17 Nov 2021 23:16:49 +0100 Subject: [PATCH 6/9] fixup! fixup! fixup! fixup! fixup! tools: fix commit-lint GH Actions CI --- .github/workflows/commit-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 45212fee6fd8ad..1c9edaba8727fd 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: ${{ steps.nb-of-commits.outputs.nb }} - - run: git --no-pager log HEAD^2~${{ github.event.pull_request.commits }} + - run: git --no-pager log $(git rev-parse HEAD^2)~${{ github.event.pull_request.commits }} # - name: Install Node.js # uses: actions/setup-node@v2 # with: From bc8938ddcfb1039a03230268a6d8381f8911eb6f Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 17 Nov 2021 23:19:32 +0100 Subject: [PATCH 7/9] fixup! fixup! fixup! fixup! fixup! fixup! tools: fix commit-lint GH Actions CI --- .github/workflows/commit-lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 1c9edaba8727fd..a747ed522153d6 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -15,7 +15,8 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: ${{ steps.nb-of-commits.outputs.nb }} - - run: git --no-pager log $(git rev-parse HEAD^2)~${{ github.event.pull_request.commits }} + - run: git reset HEAD^2 + - run: git --no-pager log HEAD~${{ github.event.pull_request.commits }} # - name: Install Node.js # uses: actions/setup-node@v2 # with: From 156d1dc6007876ddb426fad2d9bf0c62805f863e Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 17 Nov 2021 23:21:41 +0100 Subject: [PATCH 8/9] fixup! fixup! fixup! fixup! fixup! fixup! fixup! tools: fix commit-lint GH Actions CI --- .github/workflows/commit-lint.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index a747ed522153d6..b3f59946104f9f 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -11,12 +11,14 @@ jobs: 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))" + 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: ${{ steps.nb-of-commits.outputs.nb }} + fetch-depth: ${{ steps.nb-of-commits.outputs.plusOne }} - run: git reset HEAD^2 - - run: git --no-pager log HEAD~${{ github.event.pull_request.commits }} + - run: git --no-pager log HEAD~${{ steps.nb-of-commits.outputs.minusOne }} # - name: Install Node.js # uses: actions/setup-node@v2 # with: From 4c7acaaf17d7002b5864bba9265e93a6cf3ec432 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 17 Nov 2021 23:23:40 +0100 Subject: [PATCH 9/9] fixup! tools: fix commit-lint GH Actions CI --- .github/workflows/commit-lint.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index b3f59946104f9f..0f0c6d66938d2c 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -18,12 +18,11 @@ jobs: with: fetch-depth: ${{ steps.nb-of-commits.outputs.plusOne }} - run: git reset HEAD^2 - - run: git --no-pager log HEAD~${{ steps.nb-of-commits.outputs.minusOne }} - # - name: Install Node.js - # uses: actions/setup-node@v2 - # with: - # node-version: ${{ env.NODE_VERSION }} - # - name: Validate commit message - # run: | - # echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json" - # git rev-parse HEAD~${{ github.event.pull_request.commits }} | xargs npx -q core-validate-commit --no-validate-metadata --tap + - name: Install Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Validate commit message + run: | + echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json" + git rev-parse HEAD~${{ steps.nb-of-commits.outputs.minusOne }} | xargs npx -q core-validate-commit --no-validate-metadata --tap