-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (41 loc) · 1.19 KB
/
lint-commits.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
43
44
45
46
47
48
49
50
# SPDX-FileCopyrightText: 2022-2025 leha-bot and contributors
#
# SPDX-License-Identifier: BSL-1.0 OR BlueOak-1.0.0
name: 'Lint commits'
on:
push:
branches:
- '**'
pull_request:
branches:
- 'master'
- 'dev'
jobs:
lint-commits:
name: 'Lint commits'
strategy:
matrix:
system:
- ubuntu-24.04
runs-on: ${{ matrix.system }}
steps:
# Checkout whole repository
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Get parent branch name for comparing on `push` event
- name: Get branch (push)
if: github.event_name == 'push'
run: |
echo "branch=remotes/origin/${{ github.event.repository.default_branch }}" >> $GITHUB_ENV
# Get parent branch name for comparing on `pull_request` event
- name: Get branch (pull_request)
if: github.event_name == 'pull_request'
run: |
echo "branch=remotes/origin/${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
# Run commit linter from parent branch
- name: Lint commits
uses: remarkablemark/commitlint@v1
with:
from: ${{ env.branch }}