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 <[email protected]>
  • Loading branch information
aduh95 authored and targos committed Nov 26, 2021
1 parent 6e9b665 commit 6ebbd0d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
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 6ebbd0d

Please sign in to comment.