.github/workflows/commitlint.yml
name: Commitlint
on:
pull_request:
branches:
- master
jobs:
Commitlint:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js v14
uses: actions/setup-node@v2
with:
node-version: 14
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Restore npm cache
uses: actions/cache@v2
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Enviroment setup
run: npm ci
- name: PR commits check
run: npm run commitlint