-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
48 lines (47 loc) · 1.5 KB
/
action.yaml
File metadata and controls
48 lines (47 loc) · 1.5 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
name: 'convcommitlint'
description: 'Check if commits follow the conventional commits standard'
branding:
icon: 'git-commit'
color: 'gray-dark'
inputs:
fetch-depth:
description: 'git fetch depth when checking out the repository'
required: false
default: "0"
base-branch:
description: 'base branch to lint from'
required: false
default: "main"
create-review:
description: 'Creates a pull request review'
required: false
default: "true"
comment-drafts:
description: 'Create comments on draft pull requests'
required: false
default: "false"
version:
description: 'go conventional commit version to run'
required: false
default: "latest"
runs:
using: "composite"
steps:
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 #v5.5.0
with:
go-version: '>=1.24'
- name: "install conventional commit lint"
shell: bash
run: go install github.com/coolapso/convcommitlint@${{ inputs.version }}
- uses: actions/checkout@v4
with:
fetch-depth: ${{ inputs.fetch-depth }}
ref: ${{ github.head_ref }}
- name: 'get base branch last commit'
run: git fetch origin ${{ inputs.base-branch }}:${{ inputs.base-branch }} --depth 1
shell: bash
if: ${{ github.ref_name != inputs.base-branch }}
- name: "Lint commits"
shell: bash
run: |
convcommitlint -b ${{ inputs.base-branch }} --create-review=${{ inputs.create-review }} --comment-drafts=${{ inputs.comment-drafts }}