Skip to content

Commit 08f1f03

Browse files
fix(CI/CD): Fix lint commits workflow
Co-authored-by: leha-bot <[email protected]>
1 parent ecf862d commit 08f1f03

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

.github/workflows/lint-commits.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2022 leha-bot and contributors
1+
# SPDX-FileCopyrightText: 2022-2025 leha-bot and contributors
22
#
33
# SPDX-License-Identifier: BSL-1.0 OR BlueOak-1.0.0
44

@@ -10,20 +10,41 @@ on:
1010
- '**'
1111
pull_request:
1212
branches:
13-
- master
14-
- dev
13+
- 'master'
14+
- 'dev'
1515

1616
jobs:
17-
lint:
18-
name: 'Lint'
17+
lint-commits:
18+
name: 'Lint commits'
1919

20-
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
system:
23+
- ubuntu-24.04
24+
25+
runs-on: ${{ matrix.system }}
2126

2227
steps:
28+
# Checkout whole repository
2329
- name: Checkout
2430
uses: actions/checkout@v4
2531
with:
2632
fetch-depth: 0
2733

28-
- name: Lint
34+
# Get parent branch name for comparing on `push` event
35+
- name: Get branch (push)
36+
if: github.event_name == 'push'
37+
run: |
38+
echo "branch=remotes/origin/${{ github.event.repository.default_branch }}" >> $GITHUB_ENV
39+
40+
# Get parent branch name for comparing on `pull_request` event
41+
- name: Get branch (pull_request)
42+
if: github.event_name == 'pull_request'
43+
run: |
44+
echo "branch=remotes/origin/${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
45+
46+
# Run commit linter from parent branch
47+
- name: Lint commits
2948
uses: remarkablemark/commitlint@v1
49+
with:
50+
from: ${{ env.branch }}

0 commit comments

Comments
 (0)