Skip to content

Commit

Permalink
tools: fix commit-lint GH Actions CI
Browse files Browse the repository at this point in the history
PR-URL: #40845
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
aduh95 authored and jasnell committed Nov 25, 2021
1 parent 24292b4 commit 27b1088
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/commit-lint.yml
Expand Up @@ -9,14 +9,20 @@ 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:
node-version: ${{ env.NODE_VERSION }}
- 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

0 comments on commit 27b1088

Please sign in to comment.