2022-08-16 19:01:24 +08:00
|
|
|
name: Lint Commit Messages
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
commitlint:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [14.x]
|
2022-12-22 16:47:43 +08:00
|
|
|
os: [ubuntu-latest]
|
2022-08-16 19:01:24 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.npm
|
|
|
|
**/node_modules
|
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
|
|
|
- name: Install Deps
|
|
|
|
run: |
|
|
|
|
npm install -g commitlint-plugin-function-rules @commitlint/cli
|
|
|
|
npm install --save-dev commitlint-plugin-function-rules @commitlint/cli
|
|
|
|
- uses: wagoid/commitlint-github-action@v5
|
|
|
|
id: commitlint
|
|
|
|
env:
|
|
|
|
NODE_PATH: ${{ github.workspace }}/node_modules
|
|
|
|
with:
|
|
|
|
configFile: /github/workspace/.github/commitlint.config.js
|