-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (36 loc) · 998 Bytes
/
pr-checks.yml
File metadata and controls
39 lines (36 loc) · 998 Bytes
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
name: PR Checks
on:
pull_request:
types: [opened, synchronize, reopened, edited]
jobs:
title:
name: Validate PR title (Conventional Commits)
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
chore
docs
test
refactor
perf
ci
requireScope: false
size:
name: PR size check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check PR is not too large
run: |
LINES=$(git diff origin/${{ github.base_ref }}...HEAD --stat | tail -1 | grep -oP '\d+ insertion' | grep -oP '\d+' || echo 0)
if [ "$LINES" -gt 1500 ]; then
echo "::warning::This PR adds $LINES lines. Consider splitting it into smaller PRs."
fi