-
Notifications
You must be signed in to change notification settings - Fork 31
32 lines (26 loc) · 1019 Bytes
/
commit-lint.yml
File metadata and controls
32 lines (26 loc) · 1019 Bytes
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
27
28
29
30
31
32
name: Commit Compliance
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- name: Checkout code with submodule
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Run commitlint on PR
run: |
git fetch --no-tags --prune --depth=1 https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git ${{ github.event.pull_request.base.ref }}
BASE_SHA=$(git merge-base FETCH_HEAD ${{ github.event.pull_request.head.sha }})
npx --no -- commitlint --from "$BASE_SHA" --to ${{ github.event.pull_request.head.sha }} --verbose