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

build: fix commit linter on unrebased PRs #39123

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/workflows/commit-lint.yml
Expand Up @@ -2,19 +2,24 @@ 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:
- 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"
Expand Down