-
Notifications
You must be signed in to change notification settings - Fork 20
37 lines (32 loc) · 871 Bytes
/
pr.yml
File metadata and controls
37 lines (32 loc) · 871 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
name: pr
on:
pull_request:
types:
- opened
- edited
- synchronize
branches:
- main
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
lint:
name: Lint PR Title
runs-on: ubuntu-24.04
timeout-minutes: 1
steps:
- name: Lint PR Title
run: |
REGEX="^(fix|feat|refactor|revert|test|perf|style|chore|docs): [a-z][^.]{0,60}$"
if echo "${PR_TITLE}" | grep -Eq "${REGEX}"; then
echo -e "PR title is valid: ${PR_TITLE}"
else
echo -e "Invalid PR title: ${PR_TITLE}"
echo -e "PR title must match the following pattern: ${REGEX}"
exit 1
fi
env:
PR_TITLE: ${{ github.event.pull_request.title }}