-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommitlint.yml
More file actions
29 lines (28 loc) · 774 Bytes
/
commitlint.yml
File metadata and controls
29 lines (28 loc) · 774 Bytes
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
spec:
inputs:
stage:
description: 'The stage to run the job'
type: string
default: 'lint'
allow_failures:
description: 'Allow the job to fail'
type: boolean
default: false
---
commitlint:
image:
name: commitlint/commitlint:latest
entrypoint: ['']
stage: lint
script:
- if [ -n "${CI_MERGE_REQUEST_DIFF_BASE_SHA}" ]; then
echo "Linting from ${CI_MERGE_REQUEST_DIFF_BASE_SHA} to ${CI_COMMIT_SHA}";
else
echo "Linting last commit";
fi
- if [ -n "${CI_MERGE_REQUEST_DIFF_BASE_SHA}" ]; then
commitlint --from=${CI_MERGE_REQUEST_DIFF_BASE_SHA} --to=${CI_COMMIT_SHA};
else
echo "${CI_COMMIT_MESSAGE}" | commitlint;
fi
allow_failure: $[[ inputs.allow_failures ]]