-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathaction.yml
More file actions
63 lines (53 loc) · 1.77 KB
/
Copy pathaction.yml
File metadata and controls
63 lines (53 loc) · 1.77 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
name: "Commit Msg Check"
description: "Checks commit messages using a Python script"
inputs:
base:
description: "Base SHA for the commit range"
required: true
head:
description: "Head SHA for the commit range"
required: true
body-char-limit:
required: false
default: "72"
description: "Word wrap limit for each line in the body"
sub-char-limit:
required: false
default: "72"
description: "Character limit for subject"
check-blank-line:
required: false
default: "true"
description: "check for a blank line between commit title and body"
strict-line-length-check:
required: false
default: "true"
description: "When false, allows exceeding the character limit if the last word is a single token"
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Cache Python dependencies
uses: actions/cache@v6
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('${{ github.action_path }}/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
shell: bash
run: pip install -r ${{ github.action_path }}/requirements.txt
- name: Check commit messages
shell: bash
working-directory: ${{ github.workspace }}
run: |
python ${{ github.action_path }}/check_commits.py \
--base "${{ inputs.base }}" \
--head "${{ inputs.head }}" \
--body-limit "${{ inputs.body-char-limit }}" \
--sub-limit "${{ inputs.sub-char-limit }}" \
--check-blank-line "${{ inputs.check-blank-line }}" \
--strict-line-length-check "${{ inputs.strict-line-length-check }}"