-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
54 lines (52 loc) · 1.84 KB
/
action.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
51
52
53
54
---
name: 'Commit message validator'
description: >
Enforce angular commit message convention with minimal dependency only git and bash.
author: 'Sébastien Boulle'
branding:
icon: 'check-square'
color: 'green'
inputs:
no_jira:
description: 'If not empty, no validation is done on JIRA refs.'
required: false
allow_temp:
description: 'If not empty, no validation is done on `fixup!` and `squash!` commits.'
required: false
no_revert_sha1:
description: 'If not empty, reverted sha1 commit is not mandatory in revert commit message.'
required: false
header_length:
description: 'If not empty, max header_length'
required: false
body_length:
description: 'If not empty, max body_length'
required: false
jira_types:
description: 'If not empty, space separated list of types that require Jira refs'
required: false
jira_in_header:
description: 'If not empty, allow for jira ref in header'
required: false
runs:
using: "composite"
steps:
- name: Ensure that base is fetched
run: git fetch origin ${{ github.event.pull_request.base.sha }}
shell: bash
- name: Ensure that head is fetched
run: git fetch origin ${{ github.event.pull_request.head.sha }}
shell: bash
- name: Validation
run: |
${{ github.action_path }}/check.sh \
${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
env:
COMMIT_VALIDATOR_NO_JIRA: ${{ inputs.no_jira }}
COMMIT_VALIDATOR_ALLOW_TEMP: ${{ inputs.allow_temp }}
COMMIT_VALIDATOR_NO_REVERT_SHA1: ${{ inputs.no_revert_sha1 }}
GLOBAL_JIRA_TYPES: ${{ inputs.jira_types }}
GLOBAL_MAX_LENGTH: ${{ inputs.header_length }}
GLOBAL_BODY_MAX_LENGTH: ${{ inputs.body_length }}
GLOBAL_JIRA_IN_HEADER: ${{ inputs.jira_in_header }}
shell: bash