-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.34 KB
/
pr.yml
File metadata and controls
48 lines (41 loc) · 1.34 KB
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
name: pr-check
on:
pull_request:
types:
# default types
- opened
- reopened
- synchronize
# run when PR title or body changes
- edited
branches:
- main
jobs:
lint-and-format:
runs-on: ubuntu-latest
steps:
- name: Check that PR title follows conventional commits using regex
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
echo "Your PR title is '$TITLE'"
regex="(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z[[:space:]]+\))?:[[:space:]].+"
if [[ $TITLE =~ $regex ]]; then
echo "PR title follows conventional commits"
else
echo "PR title does not follow conventional commits format"
echo "Prefix your PR title with a descriptor such as 'feat:' and then summarize your change"
echo "See the following link for more information: https://www.conventionalcommits.org/en/v1.0.0/"
exit 1
fi
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/krypton"
cache: "npm"
- name: Install dependencies
run: npm install
- name: Check that project is able to be packaged
run: npm run package