Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: fix commit-lint GH Actions CI #40845

Closed
wants to merge 9 commits into from
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