2021-08-02 11:18:22 -05:00
|
|
|
name: Commitlint
|
|
|
|
|
2021-08-25 10:36:11 -05:00
|
|
|
on:
|
2022-07-01 12:30:01 -05:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'push-action/**'
|
2021-08-25 10:36:11 -05:00
|
|
|
pull_request:
|
|
|
|
types: [opened, edited, synchronize, reopened]
|
2021-08-02 11:18:22 -05:00
|
|
|
|
2022-06-17 10:58:29 -05:00
|
|
|
concurrency:
|
|
|
|
group: commitlint-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-08-02 11:18:22 -05:00
|
|
|
jobs:
|
|
|
|
lint-commits:
|
2022-07-01 14:15:04 -05:00
|
|
|
if: github.event_name == 'pull_request'
|
2021-08-02 11:18:22 -05:00
|
|
|
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-10-16 23:07:50 -05:00
|
|
|
uses: silverhand-io/actions-node-pnpm-run-steps@v2
|
2021-08-02 11:18:22 -05:00
|
|
|
|
|
|
|
- name: Commitlint
|
2022-05-05 04:00:40 -05:00
|
|
|
run: npx commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD
|
2021-08-25 10:36:11 -05:00
|
|
|
|
|
|
|
- name: Commitlint on PR title
|
2022-05-05 04:00:40 -05:00
|
|
|
run: echo '${{ github.event.pull_request.title }}' | npx commitlint
|