diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 6673f2942da89f..782565d5488d80 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -2,6 +2,9 @@ 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 @@ -9,12 +12,14 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} - # Last 100 commits should be enough for a PR - fetch-depth: 100 - - name: Use Node.js 12 - uses: actions/setup-node@v1 + fetch-depth: ${{ github.event.pull_request.commits }} + 1 + - name: Download problem matcher from HEAD + # This is needed for PR that have not been rebased. + run: curl -L https://github.com/nodejs/node/raw/HEAD/.github/workflows/commit-lint-problem-matcher.json > .github/workflows/commit-lint-problem-matcher.json + - 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"