-
-
Notifications
You must be signed in to change notification settings - Fork 36
34 lines (34 loc) · 1 KB
/
gitlint.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
---
name: gitlint
on:
push:
pull_request:
workflow_dispatch:
jobs:
checks:
runs-on: "ubuntu-latest"
if: >
github.event_name == 'pull_request' ||
(github.event.before != '0000000000000000000000000000000000000000' && !github.event.forced)
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Install gitlint
run: pip install gitlint
- name: gitlint for PR
run: >
gitlint --debug
--commits ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
if: github.event_name == 'pull_request'
- name: gitlint for push event
run: gitlint --debug --commits ${{ github.event.before }}..${{ github.event.after }}
if: github.event_name == 'push'