forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 3
26 lines (23 loc) · 1.12 KB
/
commit-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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 }}
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: ${{ env.NODE_VERSION }}
- name: Validate commit messages
run: |
echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json"
git log --oneline ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | grep -v -e fixup -e squash | awk '{ print $1 }' | xargs npx -q core-validate-commit --no-validate-metadata --tap