Skip to content
Next Next commit
tools: fix commit-lint GH Actions CI
  • Loading branch information
aduh95 committed Nov 17, 2021
commit 0499b2da37628d661c2874278ec27db3ac2191f4
8 changes: 6 additions & 2 deletions .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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