-
Notifications
You must be signed in to change notification settings - Fork 164
42 lines (36 loc) · 1.08 KB
/
commit-messages.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright (c) 2024, Zededa, Inc.
# SPDX-License-Identifier: Apache-2.0
---
name: Lint Commit Messages
on: # yamllint disable-line rule:truthy
push:
branches:
- "master"
- "[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+-stable"
pull_request:
branches:
- "master"
- "[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+-stable"
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
fetch-depth: 0
- name: Fetch the PR's head ref
run: |
git fetch origin ${{ github.event.pull_request.head.sha }}:${{ github.event.pull_request.head.ref }}
git checkout ${{ github.event.pull_request.head.ref }}
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '21'
- name: Install Commitlint
run: npm install @commitlint/config-conventional @commitlint/cli
- name: Run Commitlint
run: npx commitlint --from=origin/master --to=HEAD --config .commitlintrc.yml