-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (48 loc) · 1.48 KB
/
style-checker.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
name: '[🎨] Style Checker'
run-name: '[🎨] Style Checker - ${{ github.head_ref }}'
on:
workflow_dispatch:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup
uses: nrwl/nx-set-shas@v3
- run: npm ci
- name: Lint
run: npx nx run-many --target lint
check-commit-message:
name: Check Commit Messages
runs-on: ubuntu-latest
steps:
- name: Get PR Commits
id: 'get-pr-commits'
uses: tim-actions/get-pr-commits@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check Subject Line Length
uses: tim-actions/commit-message-checker-with-regex@v0.3.1
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: '^.{0,75}(\n.*)*$'
error: 'Subject too long (max 75)'
- name: Check Syntax
uses: tim-actions/commit-message-checker-with-regex@v0.3.1
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: '\[#\d+\] [a-zA-Z]+|\[trivial\] [a-zA-Z]+|Merge [a-zA-Z]+'
error: 'Commit messages must start with an issue number. For example "[#21] MESSAGE" or "[trivial] MESSAGE" or "Merge MESSAGE".'
one_pass_all_pass: 'false'