2021-08-02 11:18:22 -05:00
|
|
|
name: Commitlint
|
|
|
|
|
2021-08-25 10:36:11 -05:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [opened, edited, synchronize, reopened]
|
2021-08-02 11:18:22 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint-commits:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-04-22 04:13:21 -05:00
|
|
|
- uses: actions/checkout@v3
|
2021-08-02 11:18:22 -05:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2021-08-20 05:16:00 -05:00
|
|
|
- name: Setup Node and pnpm
|
2022-04-22 02:56:31 -05:00
|
|
|
uses: logto-io/actions-node-pnpm-run-steps@v1.1.0
|
2021-08-02 11:18:22 -05:00
|
|
|
with:
|
2021-08-20 05:16:00 -05:00
|
|
|
run-install: false
|
2021-08-02 11:18:22 -05:00
|
|
|
|
|
|
|
- name: Install commitlint
|
|
|
|
run: pnpm add -g @commitlint/{cli,config-conventional}
|
|
|
|
|
|
|
|
- name: Commitlint
|
|
|
|
run: commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD
|
2021-08-25 10:36:11 -05:00
|
|
|
|
|
|
|
- name: Commitlint on PR title
|
2021-08-25 10:44:35 -05:00
|
|
|
run: echo '${{ github.event.pull_request.title }}' | commitlint
|