-
-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (45 loc) · 1.63 KB
/
commitlint.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
---
name: 'commitlint'
on: # yamllint disable-line rule:truthy
- 'push'
- 'pull_request'
permissions:
contents: 'read'
jobs:
commitlint:
runs-on: 'ubuntu-latest'
steps:
- name: 'Harden Runner'
uses: 'step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6' # v2.8.1
with:
egress-policy: 'block'
allowed-endpoints: >
github.com:443
nodejs.org:443
registry.npmjs.org:443
- name: 'Checkout the repository'
uses: 'actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332' # v4.1.7
with:
fetch-depth: 0
- name: 'Install NodeJS'
uses: 'actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b' # v4.0.3
with:
# renovate dep: datasource=npm depName=node
node-version: '20.15.1'
- name: 'Install commitlint'
run: |
# renovate: datasource=npm
npm install [email protected]
# renovate: datasource=npm
npm install [email protected]
# renovate: datasource=npm
npm install [email protected]
- name: 'Validate current commit (last commit) with commitlint'
if: "github.event_name == 'push'"
run: 'npx commitlint --last --verbose'
- name: 'Validate pull request commits with commitlint'
if: "github.event_name == 'pull_request'"
run: >-
npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }}
--to ${{ github.event.pull_request.head.sha }} --verbose
...