Skip to content

Commit

Permalink
tools: avoid fetch extra commits when validating commit messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jun 23, 2021
1 parent 84d6ce9 commit e661bcb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/commit-lint.yml
Expand Up @@ -2,18 +2,23 @@ name: "Commit messages adheres to guidelines at https://goo.gl/p2fr5Q"

on: [pull_request]

env:
NODE_VERSION: 14.x

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:
# Last 100 commits should be enough for a PR
fetch-depth: 100
- name: Use Node.js 12
uses: actions/setup-node@v1
fetch-depth: ${{ steps.nb-of-commits.outputs.nb }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: ${{ env.NODE_VERSION }}
- name: Validate commit messages
run: |
echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json"
Expand Down

0 comments on commit e661bcb

Please sign in to comment.